commonality analysis
between stacked brain scan, psychopathology and genetics that predicts
cognition
Commonality analysis with the linear mixed models
Commonality between three features within a 4 level nested
structure
Measurements are nested within subjects
Subjects are nested within families
Families are nested within sites
Due to the age requirements of all the subjects. Participants within
the family are likely to be twins.
Because the data structure (number of subjects) and the modelling
methods (through grid search) are so different between baseline and
followup. The analysis is done separately between them.
Note: this model is not included in the finally manuscript.
Function to compute
the commonality coefficients
common_analysis_gene_psy_brain_multi_both <- function(data_input=gfactor_all_pred_centered_site_all){
print("full_model")
full_model <- lmer(gfactor ~ brain_savg+ brain_cws+ mental_savg+mental_cws+gene_savg_favg+gene_cws_cwf+ (1|SITE_ID_L:REL_FAMILY_ID),data = data_input)
# runs very slow with this multilevel model
# rsq_full_model <- MuMIn::r.squaredGLMM(full_model)
rsq_full_model <- performance::r2(full_model)
print("brain_psy_model")
brain_psy_model <- lmer(gfactor ~ brain_savg+ brain_cws+ mental_cws+mental_savg+ (1|SITE_ID_L:REL_FAMILY_ID),data = data_input)
rsq_brain_psy <- performance::r2(brain_psy_model)
print("gene_psy_model")
## this model has singularity problem
gene_psy_model <- lmer(gfactor ~mental_cws+mental_savg+gene_savg_favg+gene_cws_cwf+ (1|SITE_ID_L:REL_FAMILY_ID),data = data_input)
rsq_gene_psy <- performance::r2(gene_psy_model)
print("brain_gene_model")
brain_gene_model <- lmer(gfactor ~ brain_savg+ brain_cws+gene_savg_favg+gene_cws_cwf+ (1|SITE_ID_L:REL_FAMILY_ID),data = data_input)
rsq_brain_gene <- performance::r2(brain_gene_model)
print("brain_model")
brain_model <- lmer(gfactor ~ brain_savg+ brain_cws+ (1|SITE_ID_L:REL_FAMILY_ID),data = data_input)
rsq_brain <- performance::r2(brain_model)
print("psy_model")
psy_model <- lmer(gfactor ~ mental_cws+mental_savg+ (1|SITE_ID_L:REL_FAMILY_ID),data = data_input)
rsq_psy <- performance::r2(psy_model)
print("gene_model")
gene_model <- lmer(gfactor ~ gene_savg_favg+gene_cws_cwf+ (1|SITE_ID_L:REL_FAMILY_ID),data = data_input)
rsp_gene <- performance::r2(gene_model)
unique_gene_margin <- rsq_full_model$R2_marginal-rsq_brain_psy$R2_marginal
unique_brain_margin <- rsq_full_model$R2_marginal-rsq_gene_psy$R2_marginal
unique_psy_margin <- rsq_full_model$R2_marginal-rsq_brain_gene$R2_marginal
common_brain_psy_margin <- rsq_brain_gene$R2_marginal+rsq_gene_psy$R2_marginal-rsp_gene$R2_marginal-rsq_full_model$R2_marginal
common_gene_psy_margin <- rsq_brain_gene$R2_marginal+rsq_brain_psy$R2_marginal-rsq_brain$R2_marginal-rsq_full_model$R2_marginal
common_brain_gene_margin <- rsq_brain_psy$R2_marginal+rsq_gene_psy$R2_marginal-rsq_psy$R2_marginal-rsq_full_model$R2_marginal
common_brain_gene_psy_margin <-rsp_gene$R2_marginal+rsq_brain$R2_marginal+rsq_psy$R2_marginal-rsq_brain_gene$R2_marginal-rsq_gene_psy$R2_marginal-rsq_brain_psy$R2_marginal+rsq_full_model$R2_marginal
unique_gene_conditional <- rsq_full_model$R2_conditional-rsq_brain_psy$R2_conditional
unique_brain_conditional <- rsq_full_model$R2_conditional-rsq_gene_psy$R2_conditional
unique_psy_conditional <- rsq_full_model$R2_conditional-rsq_brain_gene$R2_conditional
common_brain_psy_conditional <- rsq_brain_gene$R2_conditional+rsq_gene_psy$R2_conditional-rsp_gene$R2_conditional-rsq_full_model$R2_conditional
common_gene_psy_conditional <- rsq_brain_gene$R2_conditional+rsq_brain_psy$R2_conditional-rsq_brain$R2_conditional-rsq_full_model$R2_conditional
common_brain_gene_conditional <- rsq_brain_psy$R2_conditional+rsq_gene_psy$R2_conditional-rsq_psy$R2_conditional-rsq_full_model$R2_conditional
common_brain_gene_psy_conditional <-rsp_gene$R2_conditional+rsq_brain$R2_conditional+rsq_psy$R2_conditional-rsq_brain_gene$R2_conditional-rsq_gene_psy$R2_conditional-rsq_brain_psy$R2_conditional+rsq_full_model$R2_conditional
output_common_tibble <- tibble(variable_effects = c("unique_gene",
"unique_brain",
"unique_psy",
"common_brain_psy",
"common_gene_psy",
"common_brain_gene",
"common_brain_gene_psy"),
marginal_rsq = c(unique_gene_margin,
unique_brain_margin,
unique_psy_margin,
common_brain_psy_margin,
common_gene_psy_margin,
common_brain_gene_margin,
common_brain_gene_psy_margin),
conditional_rsq = c(unique_gene_conditional,
unique_brain_conditional,
unique_psy_conditional,
common_brain_psy_conditional,
common_gene_psy_conditional,
common_brain_gene_conditional,
common_brain_gene_psy_conditional))
output_rsq_tibble <- tibble(model_names<- c("gene",
"brain",
"psy",
"brain_psy",
"gene_psy",
"brain_gene",
"brain_gene_psy"),
marginal_rsq = c(rsp_gene$R2_marginal,
rsq_brain$R2_marginal,
rsq_psy$R2_marginal,
rsq_brain_psy$R2_marginal,
rsq_gene_psy$R2_marginal,
rsq_brain_gene$R2_marginal,
rsq_full_model$R2_marginal),
conditional_rsq = c(rsp_gene$R2_conditional,
rsq_brain$R2_conditional,
rsq_psy$R2_conditional,
rsq_brain_psy$R2_conditional,
rsq_gene_psy$R2_conditional,
rsq_brain_gene$R2_conditional,
rsq_full_model$R2_conditional))
return(list(output_common_tibble=output_common_tibble,
output_rsq_tibble=output_rsq_tibble,
full_model=full_model,
brain_psy_model=brain_psy_model,
gene_psy_model=gene_psy_model,
brain_gene_model=brain_gene_model,
brain_model=brain_model,
psy_model=psy_model,
gene_model=gene_model
))
}
Process the table
results
common_analysis_gene_psy_brain_all_site_both <-common_analysis_gene_psy_brain_multi_both(data_input=data_all_baseline)
## [1] "full_model"
## [1] "brain_psy_model"
## [1] "gene_psy_model"
## [1] "brain_gene_model"
## [1] "brain_model"
## [1] "psy_model"
## [1] "gene_model"
common_analysis_gene_psy_brain_all_site_both_followup <-common_analysis_gene_psy_brain_multi_both(data_input=data_all_followup)
## [1] "full_model"
## [1] "brain_psy_model"
## [1] "gene_psy_model"
## [1] "brain_gene_model"
## [1] "brain_model"
## [1] "psy_model"
## [1] "gene_model"
baseline_plot_vec <- common_analysis_gene_psy_brain_all_site_both[[1]]$marginal_rsq
#baseline_plot_vec_corrected <- baseline_plot_vec-baseline_plot_vec[5]/6
#### get rid of the negative values
#baseline_plot_vec_corrected[5] <- 0
baseline_plot_vec_percent <- baseline_plot_vec/sum(baseline_plot_vec)*100
baseline_plot_vec_percent <- round(baseline_plot_vec_percent,2)
print(baseline_plot_vec_percent)
## Marginal R2 Marginal R2 Marginal R2 Marginal R2 Marginal R2 Marginal R2
## 1.39 54.12 15.93 20.31 1.74 0.24
## Marginal R2
## 6.28
baseline_plot_vec_raw <- baseline_plot_vec*100
baseline_plot_vec_raw <- round(baseline_plot_vec_raw,2)
print(baseline_plot_vec_raw)
## Marginal R2 Marginal R2 Marginal R2 Marginal R2 Marginal R2 Marginal R2
## 0.36 13.91 4.09 5.22 0.45 0.06
## Marginal R2
## 1.61
followup_plot_vec <- common_analysis_gene_psy_brain_all_site_both_followup[[1]]$marginal_rsq
#baseline_plot_vec_corrected_followup <- baseline_plot_vec_followup-baseline_plot_vec_followup[5]/6
#### get rid of the negative values
#baseline_plot_vec_corrected_followup[5] <- 0
followup_plot_vec_percentage <- followup_plot_vec/sum(followup_plot_vec)*100
followup_plot_vec_percentage <- round(followup_plot_vec_percentage,2)
print(followup_plot_vec_percentage)
## Marginal R2 Marginal R2 Marginal R2 Marginal R2 Marginal R2 Marginal R2
## 0.49 59.46 17.70 19.82 0.23 0.83
## Marginal R2
## 1.47
followup_plot_vec_raw <- followup_plot_vec*100
followup_plot_vec_raw <- round(followup_plot_vec_raw,2)
print(followup_plot_vec_raw)
## Marginal R2 Marginal R2 Marginal R2 Marginal R2 Marginal R2 Marginal R2
## 0.11 12.97 3.86 4.32 0.05 0.18
## Marginal R2
## 0.32
baseline_gene_psy_brain_table <- common_analysis_gene_psy_brain_all_site_both[[1]]%>%
mutate(corrected_percent = baseline_plot_vec_percent)%>%
mutate(corrected_raw = baseline_plot_vec_raw)
baseline_gene_psy_brain_table%>%
kableExtra::kbl(caption = "Commonality analysis in baseline") %>%
kableExtra::kable_classic(full_width = F,
html_font = "Cambria")
Commonality analysis in baseline
|
variable_effects
|
marginal_rsq
|
conditional_rsq
|
corrected_percent
|
corrected_raw
|
|
unique_gene
|
0.0035603
|
0.0071279
|
1.39
|
0.36
|
|
unique_brain
|
0.1390674
|
0.0363902
|
54.12
|
13.91
|
|
unique_psy
|
0.0409285
|
0.0292855
|
15.93
|
4.09
|
|
common_brain_psy
|
0.0521786
|
0.0100158
|
20.31
|
5.22
|
|
common_gene_psy
|
0.0044788
|
-0.0002736
|
1.74
|
0.45
|
|
common_brain_gene
|
0.0006228
|
0.0060062
|
0.24
|
0.06
|
|
common_brain_gene_psy
|
0.0161286
|
0.3702811
|
6.28
|
1.61
|
common_analysis_gene_psy_brain_all_site_both[[2]]%>%
kableExtra::kbl(caption = "R^2 metrics for all models in baseline") %>%
kableExtra::kable_classic(full_width = F,
html_font = "Cambria")
R^2 metrics for all models in baseline
|
model_names <- …
|
marginal_rsq
|
conditional_rsq
|
|
gene
|
0.0247904
|
0.3831416
|
|
brain
|
0.2079974
|
0.4226934
|
|
psy
|
0.1137145
|
0.4093088
|
|
brain_psy
|
0.2534047
|
0.4517052
|
|
gene_psy
|
0.1178976
|
0.4224429
|
|
brain_gene
|
0.2160364
|
0.4295476
|
|
brain_gene_psy
|
0.2569649
|
0.4588331
|
followup_gene_psy_brain_table <- common_analysis_gene_psy_brain_all_site_both_followup[[1]]%>%
mutate(corrected_percent = followup_plot_vec)%>%
mutate(corrected_raw = followup_plot_vec_raw)
followup_gene_psy_brain_table%>%
kableExtra::kbl(caption = "Commonality analysis in followup") %>%
kableExtra::kable_classic(full_width = F,
html_font = "Cambria")
Commonality analysis in followup
|
variable_effects
|
marginal_rsq
|
conditional_rsq
|
corrected_percent
|
corrected_raw
|
|
unique_gene
|
0.0010708
|
0.0116287
|
0.0010708
|
0.11
|
|
unique_brain
|
0.1296642
|
0.0391959
|
0.1296642
|
12.97
|
|
unique_psy
|
0.0385946
|
0.0141564
|
0.0385946
|
3.86
|
|
common_brain_psy
|
0.0432285
|
-0.0007575
|
0.0432285
|
4.32
|
|
common_gene_psy
|
0.0005054
|
0.0010266
|
0.0005054
|
0.05
|
|
common_brain_gene
|
0.0018009
|
0.0056914
|
0.0018009
|
0.18
|
|
common_brain_gene_psy
|
0.0032148
|
0.4777824
|
0.0032148
|
0.32
|
common_analysis_gene_psy_brain_all_site_both_followup[[2]]%>%
kableExtra::kbl(caption = "R^2 metrics for all models in followup") %>%
kableExtra::kable_classic(full_width = F,
html_font = "Cambria")
R^2 metrics for all models in followup
|
model_names <- …
|
marginal_rsq
|
conditional_rsq
|
|
gene
|
0.0065919
|
0.4961291
|
|
brain
|
0.1779084
|
0.5219121
|
|
psy
|
0.0855432
|
0.4922079
|
|
brain_psy
|
0.2170084
|
0.5370952
|
|
gene_psy
|
0.0884150
|
0.5095280
|
|
brain_gene
|
0.1794846
|
0.5345675
|
|
brain_gene_psy
|
0.2180792
|
0.5487239
|
Plot the venn
diagram
baseline percentage of rsquare plot
overrideTriple=TRUE
venn_plot_baseline_percent <- draw.triple.venn(area1 = baseline_plot_vec_percent[2]+baseline_plot_vec_percent[6]+baseline_plot_vec_percent[4]+baseline_plot_vec_percent[7],
area2 = baseline_plot_vec_percent[3]+baseline_plot_vec_percent[4]+baseline_plot_vec_percent[5]+baseline_plot_vec_percent[7],
area3 = baseline_plot_vec_percent[1]+baseline_plot_vec_percent[5]+baseline_plot_vec_percent[6]+baseline_plot_vec_percent[7],
n12 = baseline_plot_vec_percent[4]+baseline_plot_vec_percent[7],
n13 = baseline_plot_vec_percent[6]+baseline_plot_vec_percent[7],
n23 = baseline_plot_vec_percent[5]+baseline_plot_vec_percent[7],
n123 = baseline_plot_vec_percent[7],
category = c("Brain", "Mental Health", "Genes"),
fill = c("#009E73", "#D55E00", "#CC79A7"),
lty = "dashed",
cat.col = c("#009E73", "#D55E00", "#CC79A7"),
filename = NULL,
cex = 0.001, ## label font size
cat.cex = 2,### caption font size
lwd = 2,
cat.fontface = "bold",
cat.dist = c(0.1, 0.1,-0.2), # Modified
cat.pos = c(5,10,10),# Modified
print.mode="percent",
euler.d=F,
scaled=F,
reverse = F)

grid.newpage()
#grid::grid.draw(venn_plot_baseline_percent)
#invisible(dev.off())
Without any labels
overrideTriple=TRUE
venn_plot_baseline_percent <- draw.triple.venn(area1 = baseline_plot_vec_percent[2]+baseline_plot_vec_percent[6]+baseline_plot_vec_percent[4]+baseline_plot_vec_percent[7],
area2 = baseline_plot_vec_percent[3]+baseline_plot_vec_percent[4]+baseline_plot_vec_percent[5]+baseline_plot_vec_percent[7],
area3 = baseline_plot_vec_percent[1]+baseline_plot_vec_percent[5]+baseline_plot_vec_percent[6]+baseline_plot_vec_percent[7],
n12 = baseline_plot_vec_percent[4]+baseline_plot_vec_percent[7],
n13 = baseline_plot_vec_percent[6]+baseline_plot_vec_percent[7],
n23 = baseline_plot_vec_percent[5]+baseline_plot_vec_percent[7],
n123 = baseline_plot_vec_percent[7],
# category = c("Brain", "Mental Health", "Genes"),
fill = c("#009E73", "#D55E00", "#CC79A7"),
lty = "dashed",
cat.col = c("#009E73", "#D55E00", "#CC79A7"),
filename = NULL,
cex = 0.001, ## label font size
cat.cex = 2,### caption font size
lwd = 2,
cat.fontface = "bold",
cat.dist = c(0.1, 0.1,-0.1), # Modified
cat.pos = c(5,10,-10),# Modified
print.mode="percent",
euler.d=F,
scaled=F,
reverse = F)

grid.newpage()
#grid::grid.draw(venn_plot_baseline_percent)
#invisible(dev.off())
#overrideTriple=TRUE
venn_plot_baseline_percent <- draw.triple.venn(area1 = baseline_plot_vec_percent[2]+baseline_plot_vec_percent[6]+baseline_plot_vec_percent[4]+baseline_plot_vec_percent[7],
area2 = baseline_plot_vec_percent[3]+baseline_plot_vec_percent[4]+baseline_plot_vec_percent[5]+baseline_plot_vec_percent[7],
area3 = baseline_plot_vec_percent[1]+baseline_plot_vec_percent[5]+baseline_plot_vec_percent[6]+baseline_plot_vec_percent[7],
n12 = baseline_plot_vec_percent[4]+baseline_plot_vec_percent[7],
n13 = baseline_plot_vec_percent[6]+baseline_plot_vec_percent[7],
n23 = baseline_plot_vec_percent[5]+baseline_plot_vec_percent[7],
n123 = baseline_plot_vec_percent[7],
category = c("Brain", "Mental Health", "Genes"),
fill = c("#009E73", "#D55E00", "#CC79A7"),
lty = "dashed",
cat.col = c("black", "black", "black"),
filename = NULL,
cex = 2, ## label font size
cat.cex = 2,### caption font size
lwd = 2,
cat.fontface = "bold",
cat.dist = c(-0.1, -0.1,-0.1), # Modified
#cat.pos = c(-30, 150,100),# Modified
print.mode="percent"
)

grid.newpage()
#grid::grid.draw(venn_plot_baseline_percent)
#invisible(dev.off())
baseline rsquare
score plot
venn_plot_baseline_raw <- draw.triple.venn(area1 = baseline_plot_vec_raw[2]+baseline_plot_vec_raw[6]+baseline_plot_vec_raw[4]+baseline_plot_vec_raw[7],
area2 = baseline_plot_vec_raw[3]+baseline_plot_vec_raw[4]+baseline_plot_vec_raw[5]+baseline_plot_vec_raw[7],
area3 = baseline_plot_vec_raw[1]+baseline_plot_vec_raw[5]+baseline_plot_vec_raw[6]+baseline_plot_vec_raw[7],
n12 = baseline_plot_vec_raw[4]+baseline_plot_vec_raw[7],
n13 = baseline_plot_vec_raw[6]+baseline_plot_vec_raw[7],
n23 = baseline_plot_vec_raw[5]+baseline_plot_vec_raw[7],
n123 = baseline_plot_vec_raw[7],
category = c("Brain", "Mental Health", "Genes"),
fill = c("#009E73", "#D55E00", "#CC79A7"),
lty = "dashed",
cat.col = c("black", "black", "black"),
filename = NULL,
cex = 2, ## label font size
cat.cex = 2,### caption font size
lwd = 2,
cat.fontface = "bold",
cat.dist = c(-0.1, -0.1,-0.1), # Modified
#cat.pos = c(-30, 150,100),# Modified
#print.mode="percent"
)

grid.newpage()
#grid::grid.draw(venn_plot_baseline_raw)
#invisible(dev.off())
venn diagram for
followup
venn_plot_followup_percent <- draw.triple.venn(area1 = followup_plot_vec_percentage[2]+followup_plot_vec_percentage[6]+followup_plot_vec_percentage[4]+followup_plot_vec_percentage[7],
area2 = followup_plot_vec_percentage[3]+followup_plot_vec_percentage[4]+followup_plot_vec_percentage[5]+followup_plot_vec_percentage[7],
area3 = followup_plot_vec_percentage[1]+followup_plot_vec_percentage[5]+followup_plot_vec_percentage[6]+followup_plot_vec_percentage[7],
n12 = followup_plot_vec_percentage[4]+followup_plot_vec_percentage[7],
n13 = followup_plot_vec_percentage[6]+followup_plot_vec_percentage[7],
n23 = followup_plot_vec_percentage[5]+followup_plot_vec_percentage[7],
n123 = followup_plot_vec_percentage[7],
category = c("Brain", "Mental Health", "Genes"),
fill = c("#009E73", "#D55E00", "#CC79A7"),
lty = "dashed",
cat.col = c("black", "black", "black"),##change the caption color
filename = NULL,
cex = 2, ## label font size
cat.cex = 2,### caption font size
lwd = 2,
cat.fontface = "bold",
cat.dist = c(-0.1, -0.1,-0.1), # Modified
#cat.pos = c(-30, 150,100),# Modified
print.mode="percent")

grid.newpage()
#grid::grid.draw(venn_plot_followup_percent)
#invisible(dev.off())
overrideTriple=TRUE
venn_plot_baseline_percent <- draw.triple.venn(area1 = followup_plot_vec_percentage[2]+followup_plot_vec_percentage[6]+followup_plot_vec_percentage[4]+followup_plot_vec_percentage[7],
area2 = followup_plot_vec_percentage[3]+followup_plot_vec_percentage[4]+followup_plot_vec_percentage[5]+followup_plot_vec_percentage[7],
area3 = followup_plot_vec_percentage[1]+followup_plot_vec_percentage[5]+followup_plot_vec_percentage[6]+followup_plot_vec_percentage[7],
n12 = followup_plot_vec_percentage[4]+followup_plot_vec_percentage[7],
n13 = followup_plot_vec_percentage[6]+followup_plot_vec_percentage[7],
n23 = followup_plot_vec_percentage[5]+followup_plot_vec_percentage[7],
n123 = followup_plot_vec_percentage[7],
category = c("Brain", "Mental Health", "Genes"),
fill = c("#009E73", "#D55E00", "#CC79A7"),
lty = "dashed",
cat.col = c("#009E73", "#D55E00", "#CC79A7"),
filename = NULL,
cex = 0.001, ## label font size
cat.cex = 2,### caption font size
lwd = 2,
cat.fontface = "bold",
cat.dist = c(0.1, 0.1,-0.15), # Modified
cat.pos = c(5,10,-10),# Modified
print.mode="percent",
euler.d=F,
scaled=F,
reverse = F)

grid.newpage()
#grid::grid.draw(venn_plot_baseline_percent)
#invisible(dev.off())
Plot without label
overrideTriple=TRUE
venn_plot_baseline_percent <- draw.triple.venn(area1 = followup_plot_vec_percentage[2]+followup_plot_vec_percentage[6]+followup_plot_vec_percentage[4]+followup_plot_vec_percentage[7],
area2 = followup_plot_vec_percentage[3]+followup_plot_vec_percentage[4]+followup_plot_vec_percentage[5]+followup_plot_vec_percentage[7],
area3 = followup_plot_vec_percentage[1]+followup_plot_vec_percentage[5]+followup_plot_vec_percentage[6]+followup_plot_vec_percentage[7],
n12 = followup_plot_vec_percentage[4]+followup_plot_vec_percentage[7],
n13 = followup_plot_vec_percentage[6]+followup_plot_vec_percentage[7],
n23 = followup_plot_vec_percentage[5]+followup_plot_vec_percentage[7],
n123 = followup_plot_vec_percentage[7],
# category = c("Brain", "Mental Health", "Genes"),
fill = c("#009E73", "#D55E00", "#CC79A7"),
lty = "dashed",
cat.col = c("#009E73", "#D55E00", "#CC79A7"),
filename = NULL,
cex = 0.001, ## label font size
cat.cex = 2,### caption font size
lwd = 2,
cat.fontface = "bold",
cat.dist = c(0.1, 0.1,-0.1), # Modified
cat.pos = c(5,10,-10),# Modified
print.mode="percent",
euler.d=F,
scaled=F,
reverse = F)

grid.newpage()
#grid::grid.draw(venn_plot_baseline_percent)
#invisible(dev.off())
venn_plot_followup_raw <- draw.triple.venn(area1 = followup_plot_vec_raw[2]+followup_plot_vec_raw[6]+followup_plot_vec_raw[4]+followup_plot_vec_raw[7],
area2 = followup_plot_vec_raw[3]+followup_plot_vec_raw[4]+followup_plot_vec_raw[5]+followup_plot_vec_raw[7],
area3 = followup_plot_vec_raw[1]+followup_plot_vec_raw[5]+followup_plot_vec_raw[6]+followup_plot_vec_raw[7],
n12 = followup_plot_vec_raw[4]+followup_plot_vec_raw[7],
n13 = followup_plot_vec_raw[6]+followup_plot_vec_raw[7],
n23 = followup_plot_vec_raw[5]+followup_plot_vec_raw[7],
n123 = followup_plot_vec_raw[7],
category = c("Brain", "Mental Health", "Genes"),
fill = c("#009E73", "#D55E00", "#CC79A7"),
lty = "dashed",
cat.col = c("black", "black", "black"),##change the caption color
filename = NULL,
cex = 2, ## label font size
cat.cex = 2,### caption font size
lwd = 2,
cat.fontface = "bold",
cat.dist = c(-0.1, -0.1,-0.1), # Modified
#cat.pos = c(-30, 150,100),# Modified
#print.mode="percent"
)

grid.newpage()
#grid::grid.draw(venn_plot_followup_raw)
#invisible(dev.off())
commonality analysis
between stacked brain scan, social demographic lifestyle,
psychopathology and genetics that predicts cognition
Compute the
commonality effects
common_analysis_gene_psy_brain_ses <- function(data_input=data_all_baseline){
print("gene_psy_brain_ses_model")
gene_psy_brain_ses_model <- lmer(gfactor ~ mental_savg+mental_cws+brain_savg+ brain_cws+ gene_savg_favg+gene_cws_cwf+sdl_savg+sdl_cws+ (1|SITE_ID_L:REL_FAMILY_ID),data = data_input)
# runs very slow with this multilevel model
# rsq_full_model <- MuMIn::r.squaredGLMM(full_model)
rsq_gene_psy_brain_ses_model <- performance::r2(gene_psy_brain_ses_model)
print("gene_psy_brain_model")
gene_psy_brain_model <- lmer(gfactor ~ mental_savg+mental_cws+brain_savg+ brain_cws+ gene_savg_favg+gene_cws_cwf+ (1|SITE_ID_L:REL_FAMILY_ID),data = data_input)
# runs very slow with this multilevel model
# rsq_full_model <- MuMIn::r.squaredGLMM(full_model)
rsq_gene_psy_brain_model <- performance::r2(gene_psy_brain_model)
print("gene_brain_ses_model")
gene_brain_ses_model <- lmer(gfactor ~ brain_savg+ brain_cws+gene_savg_favg+gene_cws_cwf+sdl_savg+sdl_cws+ (1|SITE_ID_L:REL_FAMILY_ID),data = data_input)
# runs very slow with this multilevel model
# rsq_full_model <- MuMIn::r.squaredGLMM(full_model)
rsq_gene_brain_ses_model <- performance::r2(gene_brain_ses_model)
print("gene_psy_ses_model")
gene_psy_ses_model <- lmer(gfactor ~ mental_savg+mental_cws+gene_savg_favg+gene_cws_cwf+sdl_savg+sdl_cws+ (1|SITE_ID_L:REL_FAMILY_ID),data = data_input)
# runs very slow with this multilevel model
# rsq_full_model <- MuMIn::r.squaredGLMM(full_model)
rsq_gene_psy_ses_model <- performance::r2(gene_psy_ses_model)
print("psy_brain_ses_model")
psy_brain_ses_model <- lmer(gfactor ~ mental_savg+mental_cws+brain_savg+ brain_cws+ sdl_savg+sdl_cws+ (1|SITE_ID_L:REL_FAMILY_ID),data = data_input)
# runs very slow with this multilevel model
# rsq_full_model <- MuMIn::r.squaredGLMM(full_model)
rsq_psy_brain_ses_model <- performance::r2(psy_brain_ses_model)
print("gene_ses_model")
gene_ses_model <- lmer(gfactor ~ gene_savg_favg+gene_cws_cwf+sdl_savg+sdl_cws+ (1|SITE_ID_L:REL_FAMILY_ID),data = data_input)
# runs very slow with this multilevel model
# rsq_full_model <- MuMIn::r.squaredGLMM(full_model)
rsq_gene_ses_model <- performance::r2(gene_ses_model)
print("psy_ses_model")
psy_ses_model <- lmer(gfactor ~ mental_savg+mental_cws+sdl_savg+sdl_cws+ (1|SITE_ID_L:REL_FAMILY_ID),data = data_input)
# runs very slow with this multilevel model
# rsq_full_model <- MuMIn::r.squaredGLMM(full_model)
rsq_psy_ses_model <- performance::r2(psy_ses_model)
print("brain_ses_model")
brain_ses_model <- lmer(gfactor ~ brain_savg+ brain_cws+sdl_savg+sdl_cws+ (1|SITE_ID_L:REL_FAMILY_ID),data = data_input)
# runs very slow with this multilevel model
# rsq_full_model <- MuMIn::r.squaredGLMM(full_model)
rsq_brain_ses_model <- performance::r2(brain_ses_model)
print("brain_psy_model")
brain_psy_model <- lmer(gfactor ~ mental_savg+mental_cws+brain_savg+ brain_cws+(1|SITE_ID_L:REL_FAMILY_ID),data = data_input)
rsq_brain_psy <- performance::r2(brain_psy_model)
print("gene_psy_model")
## this model has singularity problem
gene_psy_model <- lmer(gfactor ~mental_savg+mental_cws+gene_savg_favg+gene_cws_cwf+ (1|SITE_ID_L:REL_FAMILY_ID),data = data_input)
rsq_gene_psy <- performance::r2(gene_psy_model)
print("brain_gene_model")
brain_gene_model <- lmer(gfactor ~ brain_savg+ brain_cws+gene_savg_favg+gene_cws_cwf+ (1|SITE_ID_L:REL_FAMILY_ID),data = data_input)
rsq_brain_gene <- performance::r2(brain_gene_model)
print("ses_model")
ses_model <- lmer(gfactor ~ sdl_savg+sdl_cws+ (1|SITE_ID_L:REL_FAMILY_ID),data = data_input)
# runs very slow with this multilevel model
# rsq_full_model <- MuMIn::r.squaredGLMM(full_model)
rsq_ses_model <- performance::r2(ses_model)
print("brain_model")
brain_model <- lmer(gfactor ~ brain_savg+ brain_cws+ (1|SITE_ID_L:REL_FAMILY_ID),data = data_input)
rsq_brain <- performance::r2(brain_model)
print("psy_model")
psy_model <- lmer(gfactor ~ mental_savg+mental_cws+ (1|SITE_ID_L:REL_FAMILY_ID),data = data_input)
rsq_psy <- performance::r2(psy_model)
print("gene_model")
gene_model <- lmer(gfactor ~ gene_savg_favg+gene_cws_cwf+ (1|SITE_ID_L:REL_FAMILY_ID),data = data_input)
rsp_gene <- performance::r2(gene_model)
### marginal
### unique effects
unique_gene_margin <- rsq_gene_psy_brain_ses_model$R2_marginal-rsq_psy_brain_ses_model$R2_marginal
unique_brain_margin <- rsq_gene_psy_brain_ses_model$R2_marginal-rsq_gene_psy_ses_model$R2_marginal
unique_psy_margin <- rsq_gene_psy_brain_ses_model$R2_marginal-rsq_gene_brain_ses_model$R2_marginal
unique_ses_margin <- rsq_gene_psy_brain_ses_model$R2_marginal-rsq_gene_psy_brain_model$R2_marginal
### common effects between two variables
common_brain_psy_margin <- rsq_gene_brain_ses_model$R2_marginal+rsq_gene_psy_ses_model$R2_marginal-rsq_gene_ses_model$R2_marginal-rsq_gene_psy_brain_ses_model$R2_marginal
common_gene_psy_margin <- rsq_gene_brain_ses_model$R2_marginal+rsq_psy_brain_ses_model$R2_marginal-rsq_brain_ses_model$R2_marginal-rsq_gene_psy_brain_ses_model$R2_marginal
common_brain_gene_margin <- rsq_psy_brain_ses_model$R2_marginal+rsq_gene_psy_ses_model$R2_marginal-rsq_psy_ses_model$R2_marginal-rsq_gene_psy_brain_ses_model$R2_marginal
common_brain_ses_margin <- rsq_gene_psy_brain_model$R2_marginal+rsq_gene_psy_ses_model$R2_marginal-rsq_gene_psy$R2_marginal-rsq_gene_psy_brain_ses_model$R2_marginal
common_psy_ses_margin <- rsq_gene_psy_brain_model$R2_marginal+rsq_gene_brain_ses_model$R2_marginal-rsq_brain_gene$R2_marginal-rsq_gene_psy_brain_ses_model$R2_marginal
common_gene_ses_margin <- rsq_gene_psy_brain_model$R2_marginal+rsq_psy_brain_ses_model$R2_marginal-rsq_brain_psy$R2_marginal-rsq_gene_psy_brain_ses_model$R2_marginal
# common effects between three variables
common_brain_gene_psy_margin <-rsq_brain_ses_model$R2_marginal+rsq_gene_ses_model$R2_marginal+rsq_psy_ses_model$R2_marginal-rsq_gene_brain_ses_model$R2_marginal-rsq_gene_psy_ses_model$R2_marginal-rsq_psy_brain_ses_model$R2_marginal-rsq_ses_model$R2_marginal+rsq_gene_psy_brain_ses_model$R2_marginal
common_ses_gene_psy_margin <-rsq_brain_ses_model$R2_marginal+rsq_brain_gene$R2_marginal+rsq_brain_psy$R2_marginal-rsq_gene_psy_brain_model$R2_marginal-rsq_gene_brain_ses_model$R2_marginal-rsq_psy_brain_ses_model$R2_marginal-rsq_brain$R2_marginal+rsq_gene_psy_brain_ses_model$R2_marginal
common_brain_ses_psy_margin <-rsq_brain_gene$R2_marginal+rsq_gene_ses_model$R2_marginal+rsq_gene_psy$R2_marginal-rsq_gene_psy_brain_model$R2_marginal-rsq_gene_brain_ses_model$R2_marginal-rsq_gene_psy_ses_model$R2_marginal-rsp_gene$R2_marginal+rsq_gene_psy_brain_ses_model$R2_marginal
common_brain_gene_ses_margin <-rsq_brain_psy$R2_marginal+rsq_gene_psy$R2_marginal+rsq_psy_ses_model$R2_marginal-rsq_gene_psy_brain_model$R2_marginal-rsq_gene_psy_ses_model$R2_marginal-rsq_psy_brain_ses_model$R2_marginal-rsq_psy$R2_marginal+rsq_gene_psy_brain_ses_model$R2_marginal
# common effects between four variables
common_brain_gene_psy_ses_margin <-rsq_ses_model$R2_marginal+rsq_brain$R2_marginal+rsq_psy$R2_marginal+rsp_gene$R2_marginal-rsq_gene_ses_model$R2_marginal-rsq_psy_ses_model$R2_marginal-rsq_brain_ses_model$R2_marginal-rsq_brain_psy$R2_marginal-rsq_gene_psy$R2_marginal-rsq_brain_gene$R2_marginal+rsq_gene_psy_brain_model$R2_marginal+rsq_gene_brain_ses_model$R2_marginal+rsq_gene_psy_ses_model$R2_marginal+rsq_psy_brain_ses_model$R2_marginal - rsq_gene_psy_brain_ses_model$R2_marginal
### conditional
### unique effects
unique_gene_conditional <- rsq_gene_psy_brain_ses_model$R2_conditional-rsq_psy_brain_ses_model$R2_conditional
unique_brain_conditional <- rsq_gene_psy_brain_ses_model$R2_conditional-rsq_gene_psy_ses_model$R2_conditional
unique_psy_conditional <- rsq_gene_psy_brain_ses_model$R2_conditional-rsq_gene_brain_ses_model$R2_conditional
unique_ses_conditional <- rsq_gene_psy_brain_ses_model$R2_conditional-rsq_gene_psy_brain_model$R2_conditional
### common effects between two variables
common_brain_psy_conditional <- rsq_gene_brain_ses_model$R2_conditional+rsq_gene_psy_ses_model$R2_conditional-rsq_gene_ses_model$R2_conditional-rsq_gene_psy_brain_ses_model$R2_conditional
common_gene_psy_conditional <- rsq_gene_brain_ses_model$R2_conditional+rsq_psy_brain_ses_model$R2_conditional-rsq_brain_ses_model$R2_conditional-rsq_gene_psy_brain_ses_model$R2_conditional
common_brain_gene_conditional <-
rsq_psy_brain_ses_model$R2_conditional+rsq_gene_psy_ses_model$R2_conditional-rsq_psy_ses_model$R2_conditional-rsq_gene_psy_brain_ses_model$R2_conditional
common_brain_ses_conditional <- rsq_gene_psy_brain_model$R2_conditional+rsq_gene_psy_ses_model$R2_conditional-rsq_gene_psy$R2_conditional-rsq_gene_psy_brain_ses_model$R2_conditional
common_psy_ses_conditional <- rsq_gene_psy_brain_model$R2_conditional+rsq_gene_brain_ses_model$R2_conditional-rsq_brain_gene$R2_conditional-rsq_gene_psy_brain_ses_model$R2_conditional
common_gene_ses_conditional <- rsq_gene_psy_brain_model$R2_conditional+rsq_psy_brain_ses_model$R2_conditional-rsq_brain_psy$R2_conditional-rsq_gene_psy_brain_ses_model$R2_conditional
# common effects between three variables
common_brain_gene_psy_conditional <-rsq_brain_ses_model$R2_conditional+rsq_gene_ses_model$R2_conditional+rsq_psy_ses_model$R2_conditional-rsq_gene_brain_ses_model$R2_conditional-rsq_gene_psy_ses_model$R2_conditional-rsq_psy_brain_ses_model$R2_conditional-rsq_ses_model$R2_conditional+rsq_gene_psy_brain_ses_model$R2_conditional
common_ses_gene_psy_conditional <-rsq_brain_ses_model$R2_conditional+rsq_brain_gene$R2_conditional+rsq_brain_psy$R2_conditional-rsq_gene_psy_brain_model$R2_conditional-rsq_gene_brain_ses_model$R2_conditional-rsq_psy_brain_ses_model$R2_conditional-rsq_brain$R2_conditional+rsq_gene_psy_brain_ses_model$R2_conditional
common_brain_ses_psy_conditional <-rsq_brain_gene$R2_conditional+rsq_gene_ses_model$R2_conditional+rsq_gene_psy$R2_conditional-rsq_gene_psy_brain_model$R2_conditional-rsq_gene_brain_ses_model$R2_conditional-rsq_gene_psy_ses_model$R2_conditional-rsp_gene$R2_conditional+rsq_gene_psy_brain_ses_model$R2_conditional
common_brain_gene_ses_conditional <-rsq_brain_psy$R2_conditional+rsq_gene_psy$R2_conditional+rsq_psy_ses_model$R2_conditional-rsq_gene_psy_brain_model$R2_conditional-rsq_gene_psy_ses_model$R2_conditional-rsq_psy_brain_ses_model$R2_conditional-rsq_psy$R2_conditional+rsq_gene_psy_brain_ses_model$R2_conditional
# common effects between four variables
common_brain_gene_psy_ses_conditional <-rsq_ses_model$R2_conditional+rsq_brain$R2_conditional+rsq_psy$R2_conditional+rsp_gene$R2_conditional-rsq_gene_ses_model$R2_conditional-rsq_psy_ses_model$R2_conditional-rsq_brain_ses_model$R2_conditional-rsq_brain_psy$R2_conditional-rsq_gene_psy$R2_conditional-rsq_brain_gene$R2_conditional+rsq_gene_psy_brain_model$R2_conditional+rsq_gene_brain_ses_model$R2_conditional+rsq_gene_psy_ses_model$R2_conditional+rsq_psy_brain_ses_model$R2_conditional - rsq_gene_psy_brain_ses_model$R2_conditional
## anova analysis
ses_significance <- anova(gene_psy_brain_ses_model,gene_psy_brain_model)
psy_significance <- anova(gene_psy_brain_ses_model,gene_brain_ses_model)
brain_significance <- anova(gene_psy_brain_ses_model,gene_psy_ses_model)
gene_significance <- anova(gene_psy_brain_ses_model,psy_brain_ses_model)
psy_ses_ses <- anova(psy_ses_model,psy_model)
psy_ses_psy <- anova(psy_ses_model,ses_model)
brain_psy_brain <- anova(brain_psy_model,psy_model)
brain_psy_psy <- anova(brain_psy_model,brain_model)
gene_psy_psy <- anova(gene_psy_model, gene_model)
gene_psy_gene <- anova(gene_psy_model, psy_model)
output_common_tibble <- tibble(variable_effects = c("unique_gene",
"unique_brain",
"unique_psy",
"unique_ses",
"common_brain_psy",
"common_gene_psy",
"common_brain_gene",
"common_brain_ses",
"common_psy_ses",
"common_gene_ses",
"common_brain_gene_psy",
"common_ses_gene_psy",
"common_brain_ses_psy",
"common_brain_gene_ses",
"common_brain_gene_psy_ses"),
marginal_rsq = c(unique_gene_margin,
unique_brain_margin,
unique_psy_margin,
unique_ses_margin,
common_brain_psy_margin,
common_gene_psy_margin,
common_brain_gene_margin,
common_brain_ses_margin,
common_psy_ses_margin,
common_gene_ses_margin,
common_brain_gene_psy_margin,
common_ses_gene_psy_margin,
common_brain_ses_psy_margin,
common_brain_gene_ses_margin,
common_brain_gene_psy_ses_margin),
conditional_rsq = c(unique_gene_conditional,
unique_brain_conditional,
unique_psy_conditional,
unique_ses_conditional,
common_brain_psy_conditional,
common_gene_psy_conditional,
common_brain_gene_conditional,
common_brain_ses_conditional,
common_psy_ses_conditional,
common_gene_ses_conditional,
common_brain_gene_psy_conditional,
common_ses_gene_psy_conditional,
common_brain_ses_psy_conditional,
common_brain_gene_ses_conditional,
common_brain_gene_psy_ses_conditional))
output_rsq_tibble <- tibble(model_names<- c("gene",
"brain",
"psy",
"ses",
"brain_psy",
"gene_psy",
"brain_gene",
"brain_ses",
"psy_ses",
"gene_ses",
"brain_gene_psy",
"ses_gene_psy",
"brain_ses_psy",
"brain_gene_ses",
"brain_gene_psy_ses"),
marginal_rsq = c(rsp_gene$R2_marginal,
rsq_brain$R2_marginal,
rsq_psy$R2_marginal,
rsq_ses_model$R2_marginal,
rsq_brain_psy$R2_marginal,
rsq_gene_psy$R2_marginal,
rsq_brain_gene$R2_marginal,
rsq_brain_ses_model$R2_marginal,
rsq_psy_ses_model$R2_marginal,
rsq_gene_ses_model$R2_marginal,
rsq_gene_psy_brain_model$R2_marginal,
rsq_gene_psy_ses_model$R2_marginal,
rsq_psy_brain_ses_model$R2_marginal,
rsq_gene_brain_ses_model$R2_marginal,
rsq_gene_psy_brain_ses_model$R2_marginal),
conditional_rsq = c(rsp_gene$R2_conditional,
rsq_brain$R2_conditional,
rsq_psy$R2_conditional,
rsq_ses_model$R2_conditional,
rsq_brain_psy$R2_conditional,
rsq_gene_psy$R2_conditional,
rsq_brain_gene$R2_conditional,
rsq_brain_ses_model$R2_conditional,
rsq_psy_ses_model$R2_conditional,
rsq_gene_ses_model$R2_conditional,
rsq_gene_psy_brain_model$R2_conditional,
rsq_gene_psy_ses_model$R2_conditional,
rsq_psy_brain_ses_model$R2_conditional,
rsq_gene_brain_ses_model$R2_conditional,
rsq_gene_psy_brain_ses_model$R2_conditional))
return(list(output_common_tibble=output_common_tibble,
output_rsq_tibble=output_rsq_tibble,
gene_psy_brain_ses_model=gene_psy_brain_ses_model,
gene_psy_brain_model=gene_psy_brain_model,
gene_brain_ses_model=gene_brain_ses_model,
gene_psy_ses_model=gene_psy_ses_model,
psy_brain_ses_model=psy_brain_ses_model,
gene_ses_model=gene_ses_model,
psy_ses_model=psy_ses_model,
brain_ses_model=brain_ses_model,
brain_psy_model=brain_psy_model,
gene_psy_model=gene_psy_model,
brain_gene_model=brain_gene_model,
ses_model=ses_model,
brain_model=brain_model,
psy_model=psy_model,
gene_model=gene_model,
ses_significance=ses_significance,
psy_significance=psy_significance,
brain_significance=brain_significance,
gene_significance=gene_significance,
psy_ses_ses = psy_ses_ses,
psy_ses_psy=psy_ses_psy,
brain_psy_brain = brain_psy_brain,
brain_psy_psy = brain_psy_psy,
gene_psy_psy = gene_psy_psy,
gene_psy_gene = gene_psy_gene
))
}
common_analysis_gene_psy_brain_ses_baseline <-common_analysis_gene_psy_brain_ses(data_input=data_all_baseline)
## [1] "gene_psy_brain_ses_model"
## [1] "gene_psy_brain_model"
## [1] "gene_brain_ses_model"
## [1] "gene_psy_ses_model"
## [1] "psy_brain_ses_model"
## [1] "gene_ses_model"
## [1] "psy_ses_model"
## [1] "brain_ses_model"
## [1] "brain_psy_model"
## [1] "gene_psy_model"
## [1] "brain_gene_model"
## [1] "ses_model"
## [1] "brain_model"
## [1] "psy_model"
## [1] "gene_model"
## refitting model(s) with ML (instead of REML)
## refitting model(s) with ML (instead of REML)
## refitting model(s) with ML (instead of REML)
## refitting model(s) with ML (instead of REML)
## refitting model(s) with ML (instead of REML)
## refitting model(s) with ML (instead of REML)
## refitting model(s) with ML (instead of REML)
## refitting model(s) with ML (instead of REML)
## refitting model(s) with ML (instead of REML)
## refitting model(s) with ML (instead of REML)
common_analysis_gene_psy_brain_ses_followup <-common_analysis_gene_psy_brain_ses(data_input=data_all_followup)
## [1] "gene_psy_brain_ses_model"
## [1] "gene_psy_brain_model"
## [1] "gene_brain_ses_model"
## [1] "gene_psy_ses_model"
## [1] "psy_brain_ses_model"
## [1] "gene_ses_model"
## [1] "psy_ses_model"
## [1] "brain_ses_model"
## [1] "brain_psy_model"
## [1] "gene_psy_model"
## [1] "brain_gene_model"
## [1] "ses_model"
## [1] "brain_model"
## [1] "psy_model"
## [1] "gene_model"
## refitting model(s) with ML (instead of REML)
## refitting model(s) with ML (instead of REML)
## refitting model(s) with ML (instead of REML)
## refitting model(s) with ML (instead of REML)
## refitting model(s) with ML (instead of REML)
## refitting model(s) with ML (instead of REML)
## refitting model(s) with ML (instead of REML)
## refitting model(s) with ML (instead of REML)
## refitting model(s) with ML (instead of REML)
## refitting model(s) with ML (instead of REML)
checking the significant level of the unique effects of the four
feature model
## baseline
common_analysis_gene_psy_brain_ses_baseline[["ses_significance"]]
## Data: data_input
## Models:
## gene_psy_brain_model: gfactor ~ mental_savg + mental_cws + brain_savg + brain_cws + gene_savg_favg + gene_cws_cwf + (1 | SITE_ID_L:REL_FAMILY_ID)
## gene_psy_brain_ses_model: gfactor ~ mental_savg + mental_cws + brain_savg + brain_cws + gene_savg_favg + gene_cws_cwf + sdl_savg + sdl_cws + (1 | SITE_ID_L:REL_FAMILY_ID)
## npar AIC BIC logLik deviance Chisq Df
## gene_psy_brain_model 9 13501 13561 -6741.6 13483
## gene_psy_brain_ses_model 11 13287 13360 -6632.7 13265 217.79 2
## Pr(>Chisq)
## gene_psy_brain_model
## gene_psy_brain_ses_model < 0.00000000000000022 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
common_analysis_gene_psy_brain_ses_baseline[["psy_significance"]]
## Data: data_input
## Models:
## gene_brain_ses_model: gfactor ~ brain_savg + brain_cws + gene_savg_favg + gene_cws_cwf + sdl_savg + sdl_cws + (1 | SITE_ID_L:REL_FAMILY_ID)
## gene_psy_brain_ses_model: gfactor ~ mental_savg + mental_cws + brain_savg + brain_cws + gene_savg_favg + gene_cws_cwf + sdl_savg + sdl_cws + (1 | SITE_ID_L:REL_FAMILY_ID)
## npar AIC BIC logLik deviance Chisq Df
## gene_brain_ses_model 9 13452 13511 -6716.7 13434
## gene_psy_brain_ses_model 11 13287 13360 -6632.7 13265 168.15 2
## Pr(>Chisq)
## gene_brain_ses_model
## gene_psy_brain_ses_model < 0.00000000000000022 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
common_analysis_gene_psy_brain_ses_baseline[["brain_significance"]]
## Data: data_input
## Models:
## gene_psy_ses_model: gfactor ~ mental_savg + mental_cws + gene_savg_favg + gene_cws_cwf + sdl_savg + sdl_cws + (1 | SITE_ID_L:REL_FAMILY_ID)
## gene_psy_brain_ses_model: gfactor ~ mental_savg + mental_cws + brain_savg + brain_cws + gene_savg_favg + gene_cws_cwf + sdl_savg + sdl_cws + (1 | SITE_ID_L:REL_FAMILY_ID)
## npar AIC BIC logLik deviance Chisq Df
## gene_psy_ses_model 9 14061 14121 -7021.6 14043
## gene_psy_brain_ses_model 11 13287 13360 -6632.7 13265 777.85 2
## Pr(>Chisq)
## gene_psy_ses_model
## gene_psy_brain_ses_model < 0.00000000000000022 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
common_analysis_gene_psy_brain_ses_baseline[["gene_significance"]]
## Data: data_input
## Models:
## psy_brain_ses_model: gfactor ~ mental_savg + mental_cws + brain_savg + brain_cws + sdl_savg + sdl_cws + (1 | SITE_ID_L:REL_FAMILY_ID)
## gene_psy_brain_ses_model: gfactor ~ mental_savg + mental_cws + brain_savg + brain_cws + gene_savg_favg + gene_cws_cwf + sdl_savg + sdl_cws + (1 | SITE_ID_L:REL_FAMILY_ID)
## npar AIC BIC logLik deviance Chisq Df
## psy_brain_ses_model 9 13312 13371 -6646.7 13294
## gene_psy_brain_ses_model 11 13287 13360 -6632.7 13265 28.1 2
## Pr(>Chisq)
## psy_brain_ses_model
## gene_psy_brain_ses_model 0.0000007909 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
common_analysis_gene_psy_brain_ses_followup[["ses_significance"]]
## Data: data_input
## Models:
## gene_psy_brain_model: gfactor ~ mental_savg + mental_cws + brain_savg + brain_cws + gene_savg_favg + gene_cws_cwf + (1 | SITE_ID_L:REL_FAMILY_ID)
## gene_psy_brain_ses_model: gfactor ~ mental_savg + mental_cws + brain_savg + brain_cws + gene_savg_favg + gene_cws_cwf + sdl_savg + sdl_cws + (1 | SITE_ID_L:REL_FAMILY_ID)
## npar AIC BIC logLik deviance Chisq Df
## gene_psy_brain_model 9 7788.1 7843.1 -3885.1 7770.1
## gene_psy_brain_ses_model 11 7647.7 7714.9 -3812.8 7625.7 144.42 2
## Pr(>Chisq)
## gene_psy_brain_model
## gene_psy_brain_ses_model < 0.00000000000000022 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
common_analysis_gene_psy_brain_ses_followup[["psy_significance"]]
## Data: data_input
## Models:
## gene_brain_ses_model: gfactor ~ brain_savg + brain_cws + gene_savg_favg + gene_cws_cwf + sdl_savg + sdl_cws + (1 | SITE_ID_L:REL_FAMILY_ID)
## gene_psy_brain_ses_model: gfactor ~ mental_savg + mental_cws + brain_savg + brain_cws + gene_savg_favg + gene_cws_cwf + sdl_savg + sdl_cws + (1 | SITE_ID_L:REL_FAMILY_ID)
## npar AIC BIC logLik deviance Chisq Df
## gene_brain_ses_model 9 7729.3 7784.3 -3855.7 7711.3
## gene_psy_brain_ses_model 11 7647.7 7714.9 -3812.8 7625.7 85.655 2
## Pr(>Chisq)
## gene_brain_ses_model
## gene_psy_brain_ses_model < 0.00000000000000022 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
common_analysis_gene_psy_brain_ses_followup[["brain_significance"]]
## Data: data_input
## Models:
## gene_psy_ses_model: gfactor ~ mental_savg + mental_cws + gene_savg_favg + gene_cws_cwf + sdl_savg + sdl_cws + (1 | SITE_ID_L:REL_FAMILY_ID)
## gene_psy_brain_ses_model: gfactor ~ mental_savg + mental_cws + brain_savg + brain_cws + gene_savg_favg + gene_cws_cwf + sdl_savg + sdl_cws + (1 | SITE_ID_L:REL_FAMILY_ID)
## npar AIC BIC logLik deviance Chisq Df
## gene_psy_ses_model 9 8084.3 8139.3 -4033.1 8066.3
## gene_psy_brain_ses_model 11 7647.7 7714.9 -3812.8 7625.7 440.6 2
## Pr(>Chisq)
## gene_psy_ses_model
## gene_psy_brain_ses_model < 0.00000000000000022 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
common_analysis_gene_psy_brain_ses_followup[["gene_significance"]]
## Data: data_input
## Models:
## psy_brain_ses_model: gfactor ~ mental_savg + mental_cws + brain_savg + brain_cws + sdl_savg + sdl_cws + (1 | SITE_ID_L:REL_FAMILY_ID)
## gene_psy_brain_ses_model: gfactor ~ mental_savg + mental_cws + brain_savg + brain_cws + gene_savg_favg + gene_cws_cwf + sdl_savg + sdl_cws + (1 | SITE_ID_L:REL_FAMILY_ID)
## npar AIC BIC logLik deviance Chisq Df
## psy_brain_ses_model 9 7660.4 7715.3 -3821.2 7642.4
## gene_psy_brain_ses_model 11 7647.7 7714.9 -3812.8 7625.7 16.68 2
## Pr(>Chisq)
## psy_brain_ses_model
## gene_psy_brain_ses_model 0.0002388 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
checking the significance level of the two features models
common_analysis_gene_psy_brain_ses_baseline[["psy_ses_ses"]]
## Data: data_input
## Models:
## psy_model: gfactor ~ mental_savg + mental_cws + (1 | SITE_ID_L:REL_FAMILY_ID)
## psy_ses_model: gfactor ~ mental_savg + mental_cws + sdl_savg + sdl_cws + (1 | SITE_ID_L:REL_FAMILY_ID)
## npar AIC BIC logLik deviance Chisq Df Pr(>Chisq)
## psy_model 5 14490 14523 -7240.1 14480
## psy_ses_model 7 14090 14136 -7038.0 14076 404.19 2 < 0.00000000000000022
##
## psy_model
## psy_ses_model ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
common_analysis_gene_psy_brain_ses_baseline[["psy_ses_psy"]]
## Data: data_input
## Models:
## ses_model: gfactor ~ sdl_savg + sdl_cws + (1 | SITE_ID_L:REL_FAMILY_ID)
## psy_ses_model: gfactor ~ mental_savg + mental_cws + sdl_savg + sdl_cws + (1 | SITE_ID_L:REL_FAMILY_ID)
## npar AIC BIC logLik deviance Chisq Df Pr(>Chisq)
## ses_model 5 14376 14409 -7183 14366
## psy_ses_model 7 14090 14136 -7038 14076 290.05 2 < 0.00000000000000022
##
## ses_model
## psy_ses_model ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
common_analysis_gene_psy_brain_ses_followup[["psy_ses_ses"]]
## Data: data_input
## Models:
## psy_model: gfactor ~ mental_savg + mental_cws + (1 | SITE_ID_L:REL_FAMILY_ID)
## psy_ses_model: gfactor ~ mental_savg + mental_cws + sdl_savg + sdl_cws + (1 | SITE_ID_L:REL_FAMILY_ID)
## npar AIC BIC logLik deviance Chisq Df
## psy_model 5 8314.5 8345.1 -4152.3 8304.5
## psy_ses_model 7 8102.0 8144.7 -4044.0 8088.0 216.57 2
## Pr(>Chisq)
## psy_model
## psy_ses_model < 0.00000000000000022 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
common_analysis_gene_psy_brain_ses_followup[["psy_ses_psy"]]
## Data: data_input
## Models:
## ses_model: gfactor ~ sdl_savg + sdl_cws + (1 | SITE_ID_L:REL_FAMILY_ID)
## psy_ses_model: gfactor ~ mental_savg + mental_cws + sdl_savg + sdl_cws + (1 | SITE_ID_L:REL_FAMILY_ID)
## npar AIC BIC logLik deviance Chisq Df
## ses_model 5 8257.5 8288.0 -4123.7 8247.5
## psy_ses_model 7 8102.0 8144.7 -4044.0 8088.0 159.54 2
## Pr(>Chisq)
## ses_model
## psy_ses_model < 0.00000000000000022 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
common_analysis_gene_psy_brain_ses_baseline[["brain_psy_brain"]]
## Data: data_input
## Models:
## psy_model: gfactor ~ mental_savg + mental_cws + (1 | SITE_ID_L:REL_FAMILY_ID)
## brain_psy_model: gfactor ~ mental_savg + mental_cws + brain_savg + brain_cws + (1 | SITE_ID_L:REL_FAMILY_ID)
## npar AIC BIC logLik deviance Chisq Df
## psy_model 5 14490 14523 -7240.1 14480
## brain_psy_model 7 13532 13579 -6759.3 13518 961.59 2
## Pr(>Chisq)
## psy_model
## brain_psy_model < 0.00000000000000022 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
common_analysis_gene_psy_brain_ses_baseline[["brain_psy_psy"]]
## Data: data_input
## Models:
## brain_model: gfactor ~ brain_savg + brain_cws + (1 | SITE_ID_L:REL_FAMILY_ID)
## brain_psy_model: gfactor ~ mental_savg + mental_cws + brain_savg + brain_cws + (1 | SITE_ID_L:REL_FAMILY_ID)
## npar AIC BIC logLik deviance Chisq Df
## brain_model 5 13855 13888 -6922.5 13845
## brain_psy_model 7 13532 13579 -6759.3 13518 326.42 2
## Pr(>Chisq)
## brain_model
## brain_psy_model < 0.00000000000000022 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
common_analysis_gene_psy_brain_ses_followup[["brain_psy_brain"]]
## Data: data_input
## Models:
## psy_model: gfactor ~ mental_savg + mental_cws + (1 | SITE_ID_L:REL_FAMILY_ID)
## brain_psy_model: gfactor ~ mental_savg + mental_cws + brain_savg + brain_cws + (1 | SITE_ID_L:REL_FAMILY_ID)
## npar AIC BIC logLik deviance Chisq Df
## psy_model 5 8314.5 8345.1 -4152.3 8304.5
## brain_psy_model 7 7800.9 7843.7 -3893.5 7786.9 517.58 2
## Pr(>Chisq)
## psy_model
## brain_psy_model < 0.00000000000000022 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
common_analysis_gene_psy_brain_ses_followup[["brain_psy_psy"]]
## Data: data_input
## Models:
## brain_model: gfactor ~ brain_savg + brain_cws + (1 | SITE_ID_L:REL_FAMILY_ID)
## brain_psy_model: gfactor ~ mental_savg + mental_cws + brain_savg + brain_cws + (1 | SITE_ID_L:REL_FAMILY_ID)
## npar AIC BIC logLik deviance Chisq Df
## brain_model 5 7951.4 7981.9 -3970.7 7941.4
## brain_psy_model 7 7800.9 7843.7 -3893.5 7786.9 154.45 2
## Pr(>Chisq)
## brain_model
## brain_psy_model < 0.00000000000000022 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
common_analysis_gene_psy_brain_ses_baseline[["gene_psy_psy"]]
## Data: data_input
## Models:
## gene_model: gfactor ~ gene_savg_favg + gene_cws_cwf + (1 | SITE_ID_L:REL_FAMILY_ID)
## gene_psy_model: gfactor ~ mental_savg + mental_cws + gene_savg_favg + gene_cws_cwf + (1 | SITE_ID_L:REL_FAMILY_ID)
## npar AIC BIC logLik deviance Chisq Df
## gene_model 5 15020 15053 -7504.9 15010
## gene_psy_model 7 14456 14502 -7221.0 14442 567.78 2
## Pr(>Chisq)
## gene_model
## gene_psy_model < 0.00000000000000022 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
common_analysis_gene_psy_brain_ses_baseline[["gene_psy_gene"]]
## Data: data_input
## Models:
## psy_model: gfactor ~ mental_savg + mental_cws + (1 | SITE_ID_L:REL_FAMILY_ID)
## gene_psy_model: gfactor ~ mental_savg + mental_cws + gene_savg_favg + gene_cws_cwf + (1 | SITE_ID_L:REL_FAMILY_ID)
## npar AIC BIC logLik deviance Chisq Df Pr(>Chisq)
## psy_model 5 14490 14523 -7240.1 14480
## gene_psy_model 7 14456 14502 -7221.0 14442 38.114 2 0.000000005291 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
common_analysis_gene_psy_brain_ses_followup[["gene_psy_psy"]]
## Data: data_input
## Models:
## gene_model: gfactor ~ gene_savg_favg + gene_cws_cwf + (1 | SITE_ID_L:REL_FAMILY_ID)
## gene_psy_model: gfactor ~ mental_savg + mental_cws + gene_savg_favg + gene_cws_cwf + (1 | SITE_ID_L:REL_FAMILY_ID)
## npar AIC BIC logLik deviance Chisq Df
## gene_model 5 8577.8 8608.3 -4283.9 8567.8
## gene_psy_model 7 8295.4 8338.2 -4140.7 8281.4 286.33 2
## Pr(>Chisq)
## gene_model
## gene_psy_model < 0.00000000000000022 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
common_analysis_gene_psy_brain_ses_followup[["gene_psy_gene"]]
## Data: data_input
## Models:
## psy_model: gfactor ~ mental_savg + mental_cws + (1 | SITE_ID_L:REL_FAMILY_ID)
## gene_psy_model: gfactor ~ mental_savg + mental_cws + gene_savg_favg + gene_cws_cwf + (1 | SITE_ID_L:REL_FAMILY_ID)
## npar AIC BIC logLik deviance Chisq Df Pr(>Chisq)
## psy_model 5 8314.5 8345.1 -4152.3 8304.5
## gene_psy_model 7 8295.4 8338.2 -4140.7 8281.4 23.085 2 0.00000971 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
processing the
results and plotting
This chunk needs to be checked manually for every analysis.
baseline_gene_psy_brain_ses_vec <- common_analysis_gene_psy_brain_ses_baseline[[1]]$marginal_rsq
### get rid of the negative values
baseline_gene_psy_brain_ses_vec_corrected <- baseline_gene_psy_brain_ses_vec
baseline_gene_psy_brain_ses_vec_corrected[14] <- 0
baseline_gene_psy_brain_ses_vec_corrected_percent <- baseline_gene_psy_brain_ses_vec_corrected/sum(baseline_gene_psy_brain_ses_vec_corrected)*100
baseline_gene_psy_brain_ses_vec_corrected_percent <- round(baseline_gene_psy_brain_ses_vec_corrected_percent,2)
print(baseline_gene_psy_brain_ses_vec_corrected_percent)
## Marginal R2 Marginal R2 Marginal R2 Marginal R2 Marginal R2 Marginal R2
## 0.86 36.34 7.31 10.97 7.33 0.08
## Marginal R2 Marginal R2 Marginal R2 Marginal R2 Marginal R2 Marginal R2
## 0.27 11.81 6.86 0.37 0.14 1.47
## Marginal R2 Marginal R2 Marginal R2
## 10.74 0.00 5.45
baseline_gene_psy_brain_ses_vec_corrected_raw <- baseline_gene_psy_brain_ses_vec_corrected*100
#baseline_gene_psy_brain_ses_vec_corrected_raw <- round(baseline_gene_psy_brain_ses_vec_corrected_raw,2)
print(baseline_gene_psy_brain_ses_vec_corrected_raw)
## Marginal R2 Marginal R2 Marginal R2 Marginal R2 Marginal R2 Marginal R2
## 0.24965574 10.49551818 2.11136381 3.16824582 2.11574846 0.02357059
## Marginal R2 Marginal R2 Marginal R2 Marginal R2 Marginal R2 Marginal R2
## 0.07822787 3.41121689 1.98148702 0.10637145 0.03948742 0.42430725
## Marginal R2 Marginal R2 Marginal R2
## 3.10211387 0.00000000 1.57337195
### manually assign values because there is some weird thing with label, to get the rounding at the plots right
#baseline_gene_psy_brain_ses_vec_corrected_raw[1]<- 0.02496
#baseline_gene_psy_brain_ses_vec_corrected_raw[6]<- 0.022
#baseline_gene_psy_brain_ses_vec_corrected_raw[7]<- 0.081
followup_gene_psy_brain_ses_vec <- common_analysis_gene_psy_brain_ses_followup[[1]]$marginal_rsq
### get rid of the negative values
followup_gene_psy_brain_ses_vec_corrected <- followup_gene_psy_brain_ses_vec
followup_gene_psy_brain_ses_vec_corrected[10] <- 0
followup_gene_psy_brain_ses_vec_corrected_percentage <- followup_gene_psy_brain_ses_vec_corrected/sum(followup_gene_psy_brain_ses_vec_corrected)*100
followup_gene_psy_brain_ses_vec_corrected_percentage <- round(followup_gene_psy_brain_ses_vec_corrected_percentage,2)
print(followup_gene_psy_brain_ses_vec_corrected_percentage)
## Marginal R2 Marginal R2 Marginal R2 Marginal R2 Marginal R2 Marginal R2
## 0.48 40.74 7.67 15.07 8.52 0.11
## Marginal R2 Marginal R2 Marginal R2 Marginal R2 Marginal R2 Marginal R2
## 0.53 9.71 7.35 0.00 0.13 0.09
## Marginal R2 Marginal R2 Marginal R2
## 8.30 0.17 1.12
followup_gene_psy_brain_ses_vec_corrected_raw <- followup_gene_psy_brain_ses_vec_corrected*100
#followup_gene_psy_brain_ses_vec_corrected_raw <- round(followup_gene_psy_brain_ses_vec_corrected_raw,2)
print(followup_gene_psy_brain_ses_vec_corrected_raw)
## Marginal R2 Marginal R2 Marginal R2 Marginal R2 Marginal R2 Marginal R2
## 0.12406442 10.47043256 1.97104483 3.87354361 2.19029844 0.02860481
## Marginal R2 Marginal R2 Marginal R2 Marginal R2 Marginal R2 Marginal R2
## 0.13564405 2.49598615 1.88841052 0.00000000 0.03319219 0.02193180
## Marginal R2 Marginal R2 Marginal R2
## 2.13255475 0.04445074 0.28828519
table results
baseline_table <- common_analysis_gene_psy_brain_ses_baseline[[1]]%>%
mutate(corrected_percent = baseline_gene_psy_brain_ses_vec_corrected_percent)%>%
mutate(corrected_raw = baseline_gene_psy_brain_ses_vec_corrected_raw)
baseline_table%>%
kableExtra::kbl(caption = "Commonality analysis in baseline") %>%
kableExtra::kable_classic(full_width = F,
html_font = "Cambria")
Commonality analysis in baseline
|
variable_effects
|
marginal_rsq
|
conditional_rsq
|
corrected_percent
|
corrected_raw
|
|
unique_gene
|
0.0024966
|
0.0080207
|
0.86
|
0.2496557
|
|
unique_brain
|
0.1049552
|
0.0385829
|
36.34
|
10.4955182
|
|
unique_psy
|
0.0211136
|
0.0241596
|
7.31
|
2.1113638
|
|
unique_ses
|
0.0316825
|
0.0074155
|
10.97
|
3.1682458
|
|
common_brain_psy
|
0.0211575
|
0.0155249
|
7.33
|
2.1157485
|
|
common_gene_psy
|
0.0002357
|
0.0008660
|
0.08
|
0.0235706
|
|
common_brain_gene
|
0.0007823
|
0.0053520
|
0.27
|
0.0782279
|
|
common_brain_ses
|
0.0341122
|
-0.0021927
|
11.81
|
3.4112169
|
|
common_psy_ses
|
0.0198149
|
0.0051258
|
6.86
|
1.9814870
|
|
common_gene_ses
|
0.0010637
|
-0.0008929
|
0.37
|
0.1063715
|
|
common_brain_gene_psy
|
0.0003949
|
0.0015975
|
0.14
|
0.0394874
|
|
common_ses_gene_psy
|
0.0042431
|
-0.0011396
|
1.47
|
0.4243072
|
|
common_brain_ses_psy
|
0.0310211
|
-0.0055090
|
10.74
|
3.1021139
|
|
common_brain_gene_ses
|
-0.0001595
|
0.0006542
|
0.00
|
0.0000000
|
|
common_brain_gene_psy_ses
|
0.0157337
|
0.3686836
|
5.45
|
1.5733719
|
common_analysis_gene_psy_brain_ses_baseline[[2]]%>%
kableExtra::kbl(caption = "R^2 metrics for all models in baseline") %>%
kableExtra::kable_classic(full_width = F,
html_font = "Cambria")
R^2 metrics for all models in baseline
|
model_names <- …
|
marginal_rsq
|
conditional_rsq
|
|
gene
|
0.0247904
|
0.3831416
|
|
brain
|
0.2079974
|
0.4226934
|
|
psy
|
0.1137145
|
0.4093088
|
|
ses
|
0.1375117
|
0.3721449
|
|
brain_psy
|
0.2534047
|
0.4517052
|
|
gene_psy
|
0.1178976
|
0.4224429
|
|
brain_gene
|
0.2160364
|
0.4295476
|
|
brain_ses
|
0.2648015
|
0.4332022
|
|
psy_ses
|
0.1804134
|
0.4142929
|
|
gene_ses
|
0.1414211
|
0.3879812
|
|
brain_gene_psy
|
0.2569649
|
0.4588331
|
|
ses_gene_psy
|
0.1836922
|
0.4276656
|
|
brain_ses_psy
|
0.2861508
|
0.4582278
|
|
brain_gene_ses
|
0.2675338
|
0.4420889
|
|
brain_gene_psy_ses
|
0.2886474
|
0.4662486
|
followup_table <- common_analysis_gene_psy_brain_ses_followup[[1]]%>%
mutate(correted_percent = followup_gene_psy_brain_ses_vec_corrected_percentage)%>%
mutate(corrected_raw = followup_gene_psy_brain_ses_vec_corrected_raw)
followup_table%>%
kableExtra::kbl(caption = "Commonality analysis in followup") %>%
kableExtra::kable_classic(full_width = F,
html_font = "Cambria")
Commonality analysis in followup
|
variable_effects
|
marginal_rsq
|
conditional_rsq
|
correted_percent
|
corrected_raw
|
|
unique_gene
|
0.0012406
|
0.0110840
|
0.48
|
0.1240644
|
|
unique_brain
|
0.1047043
|
0.0416755
|
40.74
|
10.4704326
|
|
unique_psy
|
0.0197104
|
0.0151567
|
7.67
|
1.9710448
|
|
unique_ses
|
0.0387354
|
0.0017974
|
15.07
|
3.8735436
|
|
common_brain_psy
|
0.0219030
|
0.0083483
|
8.52
|
2.1902984
|
|
common_gene_psy
|
0.0002860
|
0.0004074
|
0.11
|
0.0286048
|
|
common_brain_gene
|
0.0013564
|
0.0045319
|
0.53
|
0.1356440
|
|
common_brain_ses
|
0.0249599
|
-0.0024797
|
9.71
|
2.4959861
|
|
common_psy_ses
|
0.0188841
|
-0.0010003
|
7.35
|
1.8884105
|
|
common_gene_ses
|
-0.0001698
|
0.0005447
|
0.00
|
0.0000000
|
|
common_brain_gene_psy
|
0.0003319
|
0.0011640
|
0.13
|
0.0331922
|
|
common_ses_gene_psy
|
0.0002193
|
0.0006192
|
0.09
|
0.0219318
|
|
common_brain_ses_psy
|
0.0213255
|
-0.0091058
|
8.30
|
2.1325547
|
|
common_brain_gene_ses
|
0.0004445
|
0.0011595
|
0.17
|
0.0444507
|
|
common_brain_gene_psy_ses
|
0.0028829
|
0.4766184
|
1.12
|
0.2882852
|
common_analysis_gene_psy_brain_ses_followup[[2]]%>%
kableExtra::kbl(caption = "R^2 metrics for all models in followup") %>%
kableExtra::kable_classic(full_width = F,
html_font = "Cambria")
R^2 metrics for all models in followup
|
model_names <- …
|
marginal_rsq
|
conditional_rsq
|
|
gene
|
0.0065919
|
0.4961291
|
|
brain
|
0.1779084
|
0.5219121
|
|
psy
|
0.0855432
|
0.4922079
|
|
ses
|
0.1072818
|
0.4681534
|
|
brain_psy
|
0.2170084
|
0.5370952
|
|
gene_psy
|
0.0884150
|
0.5095280
|
|
brain_gene
|
0.1794846
|
0.5345675
|
|
brain_ses
|
0.2355775
|
0.5238731
|
|
psy_ses
|
0.1495132
|
0.4932299
|
|
gene_ses
|
0.1104969
|
0.4853407
|
|
brain_gene_psy
|
0.2180792
|
0.5487239
|
|
ses_gene_psy
|
0.1521103
|
0.5088457
|
|
brain_ses_psy
|
0.2555740
|
0.5394373
|
|
brain_gene_ses
|
0.2371042
|
0.5353645
|
|
brain_gene_psy_ses
|
0.2568146
|
0.5505212
|
Print mixed model
output
Linear mixed models at baseline:
tab_model(common_analysis_gene_psy_brain_ses_baseline$gene_psy_brain_ses_model,
common_analysis_gene_psy_brain_ses_baseline$gene_psy_brain_model,
common_analysis_gene_psy_brain_ses_baseline$gene_psy_ses_model,
common_analysis_gene_psy_brain_ses_baseline$psy_brain_ses_model,
common_analysis_gene_psy_brain_ses_baseline$gene_brain_ses_model,
common_analysis_gene_psy_brain_ses_baseline$psy_ses_model,
common_analysis_gene_psy_brain_ses_baseline$brain_ses_model,
common_analysis_gene_psy_brain_ses_baseline$brain_psy_model,
common_analysis_gene_psy_brain_ses_baseline$gene_psy_model,
common_analysis_gene_psy_brain_ses_baseline$brain_gene_model,
common_analysis_gene_psy_brain_ses_baseline$gene_ses_model,
common_analysis_gene_psy_brain_ses_baseline$ses_model,
common_analysis_gene_psy_brain_ses_baseline$brain_model,
common_analysis_gene_psy_brain_ses_baseline$psy_model,
common_analysis_gene_psy_brain_ses_baseline$gene_model)
|
|
gfactor
|
gfactor
|
gfactor
|
gfactor
|
gfactor
|
gfactor
|
gfactor
|
gfactor
|
gfactor
|
gfactor
|
gfactor
|
gfactor
|
gfactor
|
gfactor
|
gfactor
|
|
Predictors
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
|
(Intercept)
|
0.23
|
0.21 – 0.25
|
<0.001
|
0.23
|
0.21 – 0.26
|
<0.001
|
0.23
|
0.21 – 0.26
|
<0.001
|
0.23
|
0.21 – 0.25
|
<0.001
|
0.23
|
0.21 – 0.25
|
<0.001
|
0.23
|
0.21 – 0.26
|
<0.001
|
0.23
|
0.21 – 0.25
|
<0.001
|
0.23
|
0.21 – 0.25
|
<0.001
|
0.23
|
0.21 – 0.26
|
<0.001
|
0.23
|
0.21 – 0.26
|
<0.001
|
0.23
|
0.21 – 0.26
|
<0.001
|
0.23
|
0.21 – 0.26
|
<0.001
|
0.23
|
0.21 – 0.26
|
<0.001
|
0.23
|
0.21 – 0.26
|
<0.001
|
0.24
|
0.21 – 0.26
|
<0.001
|
|
mental savg
|
-0.01
|
-0.07 – 0.06
|
0.867
|
0.03
|
-0.03 – 0.08
|
0.347
|
0.01
|
-0.05 – 0.08
|
0.681
|
0.02
|
-0.04 – 0.08
|
0.570
|
|
|
|
0.02
|
-0.04 – 0.09
|
0.445
|
|
|
|
0.10
|
0.07 – 0.14
|
<0.001
|
0.08
|
0.04 – 0.12
|
<0.001
|
|
|
|
|
|
|
|
|
|
|
|
|
0.14
|
0.11 – 0.16
|
<0.001
|
|
|
|
|
mental cws
|
0.15
|
0.12 – 0.17
|
<0.001
|
0.19
|
0.17 – 0.21
|
<0.001
|
0.20
|
0.18 – 0.23
|
<0.001
|
0.15
|
0.13 – 0.17
|
<0.001
|
|
|
|
0.20
|
0.18 – 0.23
|
<0.001
|
|
|
|
0.19
|
0.17 – 0.21
|
<0.001
|
0.28
|
0.26 – 0.30
|
<0.001
|
|
|
|
|
|
|
|
|
|
|
|
|
0.28
|
0.26 – 0.30
|
<0.001
|
|
|
|
|
brain savg
|
0.04
|
0.00 – 0.08
|
0.044
|
0.06
|
0.02 – 0.09
|
0.003
|
|
|
|
0.02
|
-0.02 – 0.06
|
0.283
|
0.04
|
0.00 – 0.08
|
0.042
|
|
|
|
0.02
|
-0.01 – 0.06
|
0.217
|
0.04
|
0.00 – 0.08
|
0.031
|
|
|
|
0.07
|
0.04 – 0.10
|
<0.001
|
|
|
|
|
|
|
0.13
|
0.10 – 0.15
|
<0.001
|
|
|
|
|
|
|
|
brain cws
|
0.32
|
0.30 – 0.34
|
<0.001
|
0.35
|
0.33 – 0.37
|
<0.001
|
|
|
|
0.32
|
0.30 – 0.34
|
<0.001
|
0.34
|
0.32 – 0.36
|
<0.001
|
|
|
|
0.35
|
0.32 – 0.37
|
<0.001
|
0.36
|
0.33 – 0.38
|
<0.001
|
|
|
|
0.40
|
0.38 – 0.42
|
<0.001
|
|
|
|
|
|
|
0.40
|
0.38 – 0.42
|
<0.001
|
|
|
|
|
|
|
|
gene savg favg
|
-0.06
|
-0.10 – -0.01
|
0.010
|
-0.07
|
-0.11 – -0.04
|
<0.001
|
-0.04
|
-0.08 – 0.01
|
0.084
|
|
|
|
-0.05
|
-0.10 – -0.01
|
0.011
|
|
|
|
|
|
|
|
|
|
-0.06
|
-0.10 – -0.02
|
0.004
|
-0.09
|
-0.12 – -0.06
|
<0.001
|
-0.04
|
-0.08 – 0.01
|
0.086
|
|
|
|
|
|
|
|
|
|
-0.13
|
-0.15 – -0.10
|
<0.001
|
|
gene cws cwf
|
0.04
|
0.02 – 0.06
|
<0.001
|
0.04
|
0.02 – 0.06
|
<0.001
|
0.05
|
0.03 – 0.07
|
<0.001
|
|
|
|
0.04
|
0.02 – 0.06
|
<0.001
|
|
|
|
|
|
|
|
|
|
0.05
|
0.03 – 0.07
|
<0.001
|
0.04
|
0.02 – 0.06
|
<0.001
|
0.05
|
0.04 – 0.07
|
<0.001
|
|
|
|
|
|
|
|
|
|
0.06
|
0.04 – 0.08
|
<0.001
|
|
sdl savg
|
0.06
|
-0.01 – 0.13
|
0.078
|
|
|
|
0.09
|
0.02 – 0.16
|
0.008
|
0.11
|
0.05 – 0.17
|
<0.001
|
0.06
|
0.00 – 0.12
|
0.045
|
0.12
|
0.06 – 0.18
|
<0.001
|
0.12
|
0.09 – 0.16
|
<0.001
|
|
|
|
|
|
|
|
|
|
0.10
|
0.06 – 0.15
|
<0.001
|
0.14
|
0.12 – 0.17
|
<0.001
|
|
|
|
|
|
|
|
|
|
|
sdl cws
|
0.17
|
0.15 – 0.19
|
<0.001
|
|
|
|
0.25
|
0.22 – 0.27
|
<0.001
|
0.17
|
0.15 – 0.19
|
<0.001
|
0.21
|
0.19 – 0.23
|
<0.001
|
0.25
|
0.22 – 0.27
|
<0.001
|
0.21
|
0.19 – 0.23
|
<0.001
|
|
|
|
|
|
|
|
|
|
0.31
|
0.29 – 0.34
|
<0.001
|
0.31
|
0.29 – 0.34
|
<0.001
|
|
|
|
|
|
|
|
|
|
|
Random Effects
|
|
σ2
|
0.46
|
0.46
|
0.49
|
0.47
|
0.48
|
0.51
|
0.49
|
0.47
|
0.50
|
0.49
|
0.53
|
0.54
|
0.50
|
0.51
|
0.53
|
|
τ00
|
0.15 SITE_ID_L:REL_FAMILY_ID
|
0.17 SITE_ID_L:REL_FAMILY_ID
|
0.21 SITE_ID_L:REL_FAMILY_ID
|
0.15 SITE_ID_L:REL_FAMILY_ID
|
0.15 SITE_ID_L:REL_FAMILY_ID
|
0.20 SITE_ID_L:REL_FAMILY_ID
|
0.14 SITE_ID_L:REL_FAMILY_ID
|
0.17 SITE_ID_L:REL_FAMILY_ID
|
0.26 SITE_ID_L:REL_FAMILY_ID
|
0.18 SITE_ID_L:REL_FAMILY_ID
|
0.21 SITE_ID_L:REL_FAMILY_ID
|
0.20 SITE_ID_L:REL_FAMILY_ID
|
0.18 SITE_ID_L:REL_FAMILY_ID
|
0.26 SITE_ID_L:REL_FAMILY_ID
|
0.31 SITE_ID_L:REL_FAMILY_ID
|
|
ICC
|
0.25
|
0.27
|
0.30
|
0.24
|
0.24
|
0.29
|
0.23
|
0.27
|
0.35
|
0.27
|
0.29
|
0.27
|
0.27
|
0.33
|
0.37
|
|
N
|
21 SITE_ID_L
|
21 SITE_ID_L
|
21 SITE_ID_L
|
21 SITE_ID_L
|
21 SITE_ID_L
|
21 SITE_ID_L
|
21 SITE_ID_L
|
21 SITE_ID_L
|
21 SITE_ID_L
|
21 SITE_ID_L
|
21 SITE_ID_L
|
21 SITE_ID_L
|
21 SITE_ID_L
|
21 SITE_ID_L
|
21 SITE_ID_L
|
|
|
4697 REL_FAMILY_ID
|
4697 REL_FAMILY_ID
|
4697 REL_FAMILY_ID
|
4697 REL_FAMILY_ID
|
4697 REL_FAMILY_ID
|
4697 REL_FAMILY_ID
|
4697 REL_FAMILY_ID
|
4697 REL_FAMILY_ID
|
4697 REL_FAMILY_ID
|
4697 REL_FAMILY_ID
|
4697 REL_FAMILY_ID
|
4697 REL_FAMILY_ID
|
4697 REL_FAMILY_ID
|
4697 REL_FAMILY_ID
|
4697 REL_FAMILY_ID
|
|
Observations
|
5681
|
5681
|
5681
|
5681
|
5681
|
5681
|
5681
|
5681
|
5681
|
5681
|
5681
|
5681
|
5681
|
5681
|
5681
|
|
Marginal R2 / Conditional R2
|
0.289 / 0.466
|
0.257 / 0.459
|
0.184 / 0.428
|
0.286 / 0.458
|
0.268 / 0.442
|
0.180 / 0.414
|
0.265 / 0.433
|
0.253 / 0.452
|
0.118 / 0.422
|
0.216 / 0.430
|
0.141 / 0.388
|
0.138 / 0.372
|
0.208 / 0.423
|
0.114 / 0.409
|
0.025 / 0.383
|
### print individual linear mixed models for genes at baseline
## model with all four features
tab_model(common_analysis_gene_psy_brain_ses_baseline$gene_psy_brain_ses_model)
|
|
gfactor
|
|
Predictors
|
Estimates
|
CI
|
p
|
|
(Intercept)
|
0.23
|
0.21 – 0.25
|
<0.001
|
|
mental savg
|
-0.01
|
-0.07 – 0.06
|
0.867
|
|
mental cws
|
0.15
|
0.12 – 0.17
|
<0.001
|
|
brain savg
|
0.04
|
0.00 – 0.08
|
0.044
|
|
brain cws
|
0.32
|
0.30 – 0.34
|
<0.001
|
|
gene savg favg
|
-0.06
|
-0.10 – -0.01
|
0.010
|
|
gene cws cwf
|
0.04
|
0.02 – 0.06
|
<0.001
|
|
sdl savg
|
0.06
|
-0.01 – 0.13
|
0.078
|
|
sdl cws
|
0.17
|
0.15 – 0.19
|
<0.001
|
|
Random Effects
|
|
σ2
|
0.46
|
|
τ00 SITE_ID_L:REL_FAMILY_ID
|
0.15
|
|
ICC
|
0.25
|
|
N SITE_ID_L
|
21
|
|
N REL_FAMILY_ID
|
4697
|
|
Observations
|
5681
|
|
Marginal R2 / Conditional R2
|
0.289 / 0.466
|
## model with mental health and social demographic lifestyle developmental
tab_model(common_analysis_gene_psy_brain_ses_baseline$psy_ses_model)
|
|
gfactor
|
|
Predictors
|
Estimates
|
CI
|
p
|
|
(Intercept)
|
0.23
|
0.21 – 0.26
|
<0.001
|
|
mental savg
|
0.02
|
-0.04 – 0.09
|
0.445
|
|
mental cws
|
0.20
|
0.18 – 0.23
|
<0.001
|
|
sdl savg
|
0.12
|
0.06 – 0.18
|
<0.001
|
|
sdl cws
|
0.25
|
0.22 – 0.27
|
<0.001
|
|
Random Effects
|
|
σ2
|
0.51
|
|
τ00 SITE_ID_L:REL_FAMILY_ID
|
0.20
|
|
ICC
|
0.29
|
|
N SITE_ID_L
|
21
|
|
N REL_FAMILY_ID
|
4697
|
|
Observations
|
5681
|
|
Marginal R2 / Conditional R2
|
0.180 / 0.414
|
### model with brain MRI and mental health
tab_model(common_analysis_gene_psy_brain_ses_baseline$brain_psy_model)
|
|
gfactor
|
|
Predictors
|
Estimates
|
CI
|
p
|
|
(Intercept)
|
0.23
|
0.21 – 0.25
|
<0.001
|
|
mental savg
|
0.10
|
0.07 – 0.14
|
<0.001
|
|
mental cws
|
0.19
|
0.17 – 0.21
|
<0.001
|
|
brain savg
|
0.04
|
0.00 – 0.08
|
0.031
|
|
brain cws
|
0.36
|
0.33 – 0.38
|
<0.001
|
|
Random Effects
|
|
σ2
|
0.47
|
|
τ00 SITE_ID_L:REL_FAMILY_ID
|
0.17
|
|
ICC
|
0.27
|
|
N SITE_ID_L
|
21
|
|
N REL_FAMILY_ID
|
4697
|
|
Observations
|
5681
|
|
Marginal R2 / Conditional R2
|
0.253 / 0.452
|
### model with gene and mental health
tab_model(common_analysis_gene_psy_brain_ses_baseline$gene_psy_model,
common_analysis_gene_psy_brain_ses_baseline$psy_model,
common_analysis_gene_psy_brain_ses_baseline$gene_model
)
|
|
gfactor
|
gfactor
|
gfactor
|
|
Predictors
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
|
(Intercept)
|
0.23
|
0.21 – 0.26
|
<0.001
|
0.23
|
0.21 – 0.26
|
<0.001
|
0.24
|
0.21 – 0.26
|
<0.001
|
|
mental savg
|
0.08
|
0.04 – 0.12
|
<0.001
|
0.14
|
0.11 – 0.16
|
<0.001
|
|
|
|
|
mental cws
|
0.28
|
0.26 – 0.30
|
<0.001
|
0.28
|
0.26 – 0.30
|
<0.001
|
|
|
|
|
gene savg favg
|
-0.06
|
-0.10 – -0.02
|
0.004
|
|
|
|
-0.13
|
-0.15 – -0.10
|
<0.001
|
|
gene cws cwf
|
0.05
|
0.03 – 0.07
|
<0.001
|
|
|
|
0.06
|
0.04 – 0.08
|
<0.001
|
|
Random Effects
|
|
σ2
|
0.50
|
0.51
|
0.53
|
|
τ00
|
0.26 SITE_ID_L:REL_FAMILY_ID
|
0.26 SITE_ID_L:REL_FAMILY_ID
|
0.31 SITE_ID_L:REL_FAMILY_ID
|
|
ICC
|
0.35
|
0.33
|
0.37
|
|
N
|
21 SITE_ID_L
|
21 SITE_ID_L
|
21 SITE_ID_L
|
|
|
4697 REL_FAMILY_ID
|
4697 REL_FAMILY_ID
|
4697 REL_FAMILY_ID
|
|
Observations
|
5681
|
5681
|
5681
|
|
Marginal R2 / Conditional R2
|
0.118 / 0.422
|
0.114 / 0.409
|
0.025 / 0.383
|
tab_model(common_analysis_gene_psy_brain_ses_baseline$gene_psy_brain_ses_model,
common_analysis_gene_psy_brain_ses_baseline$brain_psy_model,
common_analysis_gene_psy_brain_ses_baseline$gene_psy_model,
common_analysis_gene_psy_brain_ses_baseline$psy_ses_model)
|
|
gfactor
|
gfactor
|
gfactor
|
gfactor
|
|
Predictors
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
|
(Intercept)
|
0.23
|
0.21 – 0.25
|
<0.001
|
0.23
|
0.21 – 0.25
|
<0.001
|
0.23
|
0.21 – 0.26
|
<0.001
|
0.23
|
0.21 – 0.26
|
<0.001
|
|
mental savg
|
-0.01
|
-0.07 – 0.06
|
0.867
|
0.10
|
0.07 – 0.14
|
<0.001
|
0.08
|
0.04 – 0.12
|
<0.001
|
0.02
|
-0.04 – 0.09
|
0.445
|
|
mental cws
|
0.15
|
0.12 – 0.17
|
<0.001
|
0.19
|
0.17 – 0.21
|
<0.001
|
0.28
|
0.26 – 0.30
|
<0.001
|
0.20
|
0.18 – 0.23
|
<0.001
|
|
brain savg
|
0.04
|
0.00 – 0.08
|
0.044
|
0.04
|
0.00 – 0.08
|
0.031
|
|
|
|
|
|
|
|
brain cws
|
0.32
|
0.30 – 0.34
|
<0.001
|
0.36
|
0.33 – 0.38
|
<0.001
|
|
|
|
|
|
|
|
gene savg favg
|
-0.06
|
-0.10 – -0.01
|
0.010
|
|
|
|
-0.06
|
-0.10 – -0.02
|
0.004
|
|
|
|
|
gene cws cwf
|
0.04
|
0.02 – 0.06
|
<0.001
|
|
|
|
0.05
|
0.03 – 0.07
|
<0.001
|
|
|
|
|
sdl savg
|
0.06
|
-0.01 – 0.13
|
0.078
|
|
|
|
|
|
|
0.12
|
0.06 – 0.18
|
<0.001
|
|
sdl cws
|
0.17
|
0.15 – 0.19
|
<0.001
|
|
|
|
|
|
|
0.25
|
0.22 – 0.27
|
<0.001
|
|
Random Effects
|
|
σ2
|
0.46
|
0.47
|
0.50
|
0.51
|
|
τ00
|
0.15 SITE_ID_L:REL_FAMILY_ID
|
0.17 SITE_ID_L:REL_FAMILY_ID
|
0.26 SITE_ID_L:REL_FAMILY_ID
|
0.20 SITE_ID_L:REL_FAMILY_ID
|
|
ICC
|
0.25
|
0.27
|
0.35
|
0.29
|
|
N
|
21 SITE_ID_L
|
21 SITE_ID_L
|
21 SITE_ID_L
|
21 SITE_ID_L
|
|
|
4697 REL_FAMILY_ID
|
4697 REL_FAMILY_ID
|
4697 REL_FAMILY_ID
|
4697 REL_FAMILY_ID
|
|
Observations
|
5681
|
5681
|
5681
|
5681
|
|
Marginal R2 / Conditional R2
|
0.289 / 0.466
|
0.253 / 0.452
|
0.118 / 0.422
|
0.180 / 0.414
|
Linear mixed models at followup
tab_model(common_analysis_gene_psy_brain_ses_followup$gene_psy_brain_ses_model,
common_analysis_gene_psy_brain_ses_followup$gene_psy_brain_model,
common_analysis_gene_psy_brain_ses_followup$gene_psy_ses_model,
common_analysis_gene_psy_brain_ses_followup$psy_brain_ses_model,
common_analysis_gene_psy_brain_ses_followup$gene_brain_ses_model,
common_analysis_gene_psy_brain_ses_followup$psy_ses_model,
common_analysis_gene_psy_brain_ses_followup$brain_ses_model,
common_analysis_gene_psy_brain_ses_followup$brain_psy_model,
common_analysis_gene_psy_brain_ses_followup$gene_psy_model,
common_analysis_gene_psy_brain_ses_followup$brain_gene_model,
common_analysis_gene_psy_brain_ses_followup$gene_ses_model,
common_analysis_gene_psy_brain_ses_followup$ses_model,
common_analysis_gene_psy_brain_ses_followup$brain_model,
common_analysis_gene_psy_brain_ses_followup$psy_model,
common_analysis_gene_psy_brain_ses_followup$gene_model)
|
|
gfactor
|
gfactor
|
gfactor
|
gfactor
|
gfactor
|
gfactor
|
gfactor
|
gfactor
|
gfactor
|
gfactor
|
gfactor
|
gfactor
|
gfactor
|
gfactor
|
gfactor
|
|
Predictors
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
|
(Intercept)
|
1.04
|
1.01 – 1.07
|
<0.001
|
1.04
|
1.01 – 1.07
|
<0.001
|
1.04
|
1.01 – 1.07
|
<0.001
|
1.04
|
1.01 – 1.07
|
<0.001
|
1.04
|
1.01 – 1.07
|
<0.001
|
1.04
|
1.01 – 1.07
|
<0.001
|
1.04
|
1.01 – 1.07
|
<0.001
|
1.04
|
1.01 – 1.07
|
<0.001
|
1.04
|
1.01 – 1.07
|
<0.001
|
1.04
|
1.01 – 1.07
|
<0.001
|
1.04
|
1.01 – 1.07
|
<0.001
|
1.04
|
1.01 – 1.07
|
<0.001
|
1.04
|
1.01 – 1.07
|
<0.001
|
1.04
|
1.01 – 1.07
|
<0.001
|
1.04
|
1.01 – 1.08
|
<0.001
|
|
mental savg
|
0.03
|
-0.03 – 0.08
|
0.339
|
0.04
|
-0.00 – 0.08
|
0.057
|
0.02
|
-0.03 – 0.08
|
0.395
|
0.03
|
-0.02 – 0.08
|
0.191
|
|
|
|
0.03
|
-0.02 – 0.09
|
0.239
|
|
|
|
0.04
|
0.00 – 0.08
|
0.027
|
0.06
|
0.02 – 0.09
|
0.002
|
|
|
|
|
|
|
|
|
|
|
|
|
0.07
|
0.04 – 0.10
|
<0.001
|
|
|
|
|
mental cws
|
0.13
|
0.10 – 0.16
|
<0.001
|
0.17
|
0.15 – 0.20
|
<0.001
|
0.19
|
0.16 – 0.22
|
<0.001
|
0.13
|
0.10 – 0.16
|
<0.001
|
|
|
|
0.19
|
0.16 – 0.22
|
<0.001
|
|
|
|
0.18
|
0.15 – 0.20
|
<0.001
|
0.25
|
0.22 – 0.28
|
<0.001
|
|
|
|
|
|
|
|
|
|
|
|
|
0.25
|
0.23 – 0.28
|
<0.001
|
|
|
|
|
brain savg
|
0.02
|
-0.03 – 0.07
|
0.477
|
0.03
|
-0.01 – 0.07
|
0.148
|
|
|
|
0.03
|
-0.02 – 0.07
|
0.306
|
0.02
|
-0.03 – 0.07
|
0.551
|
|
|
|
0.02
|
-0.03 – 0.07
|
0.341
|
0.03
|
-0.01 – 0.07
|
0.089
|
|
|
|
0.05
|
0.02 – 0.08
|
0.002
|
|
|
|
|
|
|
0.06
|
0.03 – 0.09
|
<0.001
|
|
|
|
|
|
|
|
brain cws
|
0.30
|
0.27 – 0.33
|
<0.001
|
0.33
|
0.30 – 0.36
|
<0.001
|
|
|
|
0.30
|
0.28 – 0.33
|
<0.001
|
0.33
|
0.30 – 0.35
|
<0.001
|
|
|
|
0.33
|
0.30 – 0.36
|
<0.001
|
0.33
|
0.30 – 0.36
|
<0.001
|
|
|
|
0.37
|
0.34 – 0.40
|
<0.001
|
|
|
|
|
|
|
0.37
|
0.35 – 0.40
|
<0.001
|
|
|
|
|
|
|
|
gene savg favg
|
-0.01
|
-0.04 – 0.02
|
0.505
|
-0.01
|
-0.04 – 0.02
|
0.586
|
-0.01
|
-0.05 – 0.02
|
0.500
|
|
|
|
-0.02
|
-0.05 – 0.02
|
0.314
|
|
|
|
|
|
|
|
|
|
-0.01
|
-0.05 – 0.02
|
0.518
|
-0.02
|
-0.05 – 0.01
|
0.272
|
-0.02
|
-0.05 – 0.02
|
0.340
|
|
|
|
|
|
|
|
|
|
-0.04
|
-0.07 – -0.01
|
0.015
|
|
gene cws cwf
|
0.04
|
0.02 – 0.06
|
<0.001
|
0.04
|
0.02 – 0.06
|
<0.001
|
0.05
|
0.03 – 0.07
|
<0.001
|
|
|
|
0.04
|
0.02 – 0.06
|
<0.001
|
|
|
|
|
|
|
|
|
|
0.05
|
0.03 – 0.07
|
<0.001
|
0.04
|
0.02 – 0.06
|
<0.001
|
0.05
|
0.03 – 0.07
|
<0.001
|
|
|
|
|
|
|
|
|
|
0.06
|
0.03 – 0.08
|
<0.001
|
|
sdl savg
|
0.02
|
-0.05 – 0.09
|
0.523
|
|
|
|
0.04
|
-0.02 – 0.09
|
0.171
|
0.02
|
-0.05 – 0.08
|
0.621
|
0.04
|
-0.01 – 0.09
|
0.080
|
0.04
|
-0.01 – 0.09
|
0.156
|
0.05
|
-0.00 – 0.10
|
0.062
|
|
|
|
|
|
|
|
|
|
0.06
|
0.02 – 0.09
|
0.001
|
0.07
|
0.04 – 0.10
|
<0.001
|
|
|
|
|
|
|
|
|
|
|
sdl cws
|
0.18
|
0.15 – 0.21
|
<0.001
|
|
|
|
0.23
|
0.20 – 0.26
|
<0.001
|
0.18
|
0.15 – 0.21
|
<0.001
|
0.21
|
0.18 – 0.24
|
<0.001
|
0.23
|
0.20 – 0.26
|
<0.001
|
0.21
|
0.18 – 0.24
|
<0.001
|
|
|
|
|
|
|
|
|
|
0.29
|
0.26 – 0.31
|
<0.001
|
0.29
|
0.26 – 0.32
|
<0.001
|
|
|
|
|
|
|
|
|
|
|
Random Effects
|
|
σ2
|
0.36
|
0.36
|
0.40
|
0.37
|
0.37
|
0.41
|
0.38
|
0.37
|
0.40
|
0.37
|
0.42
|
0.43
|
0.38
|
0.41
|
0.41
|
|
τ00
|
0.24 SITE_ID_L:REL_FAMILY_ID
|
0.27 SITE_ID_L:REL_FAMILY_ID
|
0.29 SITE_ID_L:REL_FAMILY_ID
|
0.23 SITE_ID_L:REL_FAMILY_ID
|
0.24 SITE_ID_L:REL_FAMILY_ID
|
0.28 SITE_ID_L:REL_FAMILY_ID
|
0.23 SITE_ID_L:REL_FAMILY_ID
|
0.26 SITE_ID_L:REL_FAMILY_ID
|
0.34 SITE_ID_L:REL_FAMILY_ID
|
0.28 SITE_ID_L:REL_FAMILY_ID
|
0.30 SITE_ID_L:REL_FAMILY_ID
|
0.29 SITE_ID_L:REL_FAMILY_ID
|
0.28 SITE_ID_L:REL_FAMILY_ID
|
0.33 SITE_ID_L:REL_FAMILY_ID
|
0.40 SITE_ID_L:REL_FAMILY_ID
|
|
ICC
|
0.40
|
0.42
|
0.42
|
0.38
|
0.39
|
0.40
|
0.38
|
0.41
|
0.46
|
0.43
|
0.42
|
0.40
|
0.42
|
0.44
|
0.49
|
|
N
|
21 SITE_ID_L
|
21 SITE_ID_L
|
21 SITE_ID_L
|
21 SITE_ID_L
|
21 SITE_ID_L
|
21 SITE_ID_L
|
21 SITE_ID_L
|
21 SITE_ID_L
|
21 SITE_ID_L
|
21 SITE_ID_L
|
21 SITE_ID_L
|
21 SITE_ID_L
|
21 SITE_ID_L
|
21 SITE_ID_L
|
21 SITE_ID_L
|
|
|
2840 REL_FAMILY_ID
|
2840 REL_FAMILY_ID
|
2840 REL_FAMILY_ID
|
2840 REL_FAMILY_ID
|
2840 REL_FAMILY_ID
|
2840 REL_FAMILY_ID
|
2840 REL_FAMILY_ID
|
2840 REL_FAMILY_ID
|
2840 REL_FAMILY_ID
|
2840 REL_FAMILY_ID
|
2840 REL_FAMILY_ID
|
2840 REL_FAMILY_ID
|
2840 REL_FAMILY_ID
|
2840 REL_FAMILY_ID
|
2840 REL_FAMILY_ID
|
|
Observations
|
3321
|
3321
|
3321
|
3321
|
3321
|
3321
|
3321
|
3321
|
3321
|
3321
|
3321
|
3321
|
3321
|
3321
|
3321
|
|
Marginal R2 / Conditional R2
|
0.257 / 0.551
|
0.218 / 0.549
|
0.152 / 0.509
|
0.256 / 0.539
|
0.237 / 0.535
|
0.150 / 0.493
|
0.236 / 0.524
|
0.217 / 0.537
|
0.088 / 0.510
|
0.179 / 0.535
|
0.110 / 0.485
|
0.107 / 0.468
|
0.178 / 0.522
|
0.086 / 0.492
|
0.007 / 0.496
|
### print individual linear mixed models for genes at followup
## model with all four features
tab_model(common_analysis_gene_psy_brain_ses_followup$gene_psy_brain_ses_model)
|
|
gfactor
|
|
Predictors
|
Estimates
|
CI
|
p
|
|
(Intercept)
|
1.04
|
1.01 – 1.07
|
<0.001
|
|
mental savg
|
0.03
|
-0.03 – 0.08
|
0.339
|
|
mental cws
|
0.13
|
0.10 – 0.16
|
<0.001
|
|
brain savg
|
0.02
|
-0.03 – 0.07
|
0.477
|
|
brain cws
|
0.30
|
0.27 – 0.33
|
<0.001
|
|
gene savg favg
|
-0.01
|
-0.04 – 0.02
|
0.505
|
|
gene cws cwf
|
0.04
|
0.02 – 0.06
|
<0.001
|
|
sdl savg
|
0.02
|
-0.05 – 0.09
|
0.523
|
|
sdl cws
|
0.18
|
0.15 – 0.21
|
<0.001
|
|
Random Effects
|
|
σ2
|
0.36
|
|
τ00 SITE_ID_L:REL_FAMILY_ID
|
0.24
|
|
ICC
|
0.40
|
|
N SITE_ID_L
|
21
|
|
N REL_FAMILY_ID
|
2840
|
|
Observations
|
3321
|
|
Marginal R2 / Conditional R2
|
0.257 / 0.551
|
## model with mental health and social demographic lifestyle developmental
tab_model(common_analysis_gene_psy_brain_ses_followup$psy_ses_model)
|
|
gfactor
|
|
Predictors
|
Estimates
|
CI
|
p
|
|
(Intercept)
|
1.04
|
1.01 – 1.07
|
<0.001
|
|
mental savg
|
0.03
|
-0.02 – 0.09
|
0.239
|
|
mental cws
|
0.19
|
0.16 – 0.22
|
<0.001
|
|
sdl savg
|
0.04
|
-0.01 – 0.09
|
0.156
|
|
sdl cws
|
0.23
|
0.20 – 0.26
|
<0.001
|
|
Random Effects
|
|
σ2
|
0.41
|
|
τ00 SITE_ID_L:REL_FAMILY_ID
|
0.28
|
|
ICC
|
0.40
|
|
N SITE_ID_L
|
21
|
|
N REL_FAMILY_ID
|
2840
|
|
Observations
|
3321
|
|
Marginal R2 / Conditional R2
|
0.150 / 0.493
|
### model with brain MRI and mental health
tab_model(common_analysis_gene_psy_brain_ses_followup$brain_psy_model)
|
|
gfactor
|
|
Predictors
|
Estimates
|
CI
|
p
|
|
(Intercept)
|
1.04
|
1.01 – 1.07
|
<0.001
|
|
mental savg
|
0.04
|
0.00 – 0.08
|
0.027
|
|
mental cws
|
0.18
|
0.15 – 0.20
|
<0.001
|
|
brain savg
|
0.03
|
-0.01 – 0.07
|
0.089
|
|
brain cws
|
0.33
|
0.30 – 0.36
|
<0.001
|
|
Random Effects
|
|
σ2
|
0.37
|
|
τ00 SITE_ID_L:REL_FAMILY_ID
|
0.26
|
|
ICC
|
0.41
|
|
N SITE_ID_L
|
21
|
|
N REL_FAMILY_ID
|
2840
|
|
Observations
|
3321
|
|
Marginal R2 / Conditional R2
|
0.217 / 0.537
|
### model with gene and mental health
tab_model(common_analysis_gene_psy_brain_ses_followup$gene_psy_model,
common_analysis_gene_psy_brain_ses_followup$psy_model,
common_analysis_gene_psy_brain_ses_followup$gene_model)
|
|
gfactor
|
gfactor
|
gfactor
|
|
Predictors
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
|
(Intercept)
|
1.04
|
1.01 – 1.07
|
<0.001
|
1.04
|
1.01 – 1.07
|
<0.001
|
1.04
|
1.01 – 1.08
|
<0.001
|
|
mental savg
|
0.06
|
0.02 – 0.09
|
0.002
|
0.07
|
0.04 – 0.10
|
<0.001
|
|
|
|
|
mental cws
|
0.25
|
0.22 – 0.28
|
<0.001
|
0.25
|
0.23 – 0.28
|
<0.001
|
|
|
|
|
gene savg favg
|
-0.01
|
-0.05 – 0.02
|
0.518
|
|
|
|
-0.04
|
-0.07 – -0.01
|
0.015
|
|
gene cws cwf
|
0.05
|
0.03 – 0.07
|
<0.001
|
|
|
|
0.06
|
0.03 – 0.08
|
<0.001
|
|
Random Effects
|
|
σ2
|
0.40
|
0.41
|
0.41
|
|
τ00
|
0.34 SITE_ID_L:REL_FAMILY_ID
|
0.33 SITE_ID_L:REL_FAMILY_ID
|
0.40 SITE_ID_L:REL_FAMILY_ID
|
|
ICC
|
0.46
|
0.44
|
0.49
|
|
N
|
21 SITE_ID_L
|
21 SITE_ID_L
|
21 SITE_ID_L
|
|
|
2840 REL_FAMILY_ID
|
2840 REL_FAMILY_ID
|
2840 REL_FAMILY_ID
|
|
Observations
|
3321
|
3321
|
3321
|
|
Marginal R2 / Conditional R2
|
0.088 / 0.510
|
0.086 / 0.492
|
0.007 / 0.496
|
tab_model(common_analysis_gene_psy_brain_ses_followup$gene_psy_brain_ses_model,
common_analysis_gene_psy_brain_ses_followup$brain_psy_model,
common_analysis_gene_psy_brain_ses_followup$gene_psy_model,
common_analysis_gene_psy_brain_ses_followup$psy_ses_model)
|
|
gfactor
|
gfactor
|
gfactor
|
gfactor
|
|
Predictors
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
Estimates
|
CI
|
p
|
|
(Intercept)
|
1.04
|
1.01 – 1.07
|
<0.001
|
1.04
|
1.01 – 1.07
|
<0.001
|
1.04
|
1.01 – 1.07
|
<0.001
|
1.04
|
1.01 – 1.07
|
<0.001
|
|
mental savg
|
0.03
|
-0.03 – 0.08
|
0.339
|
0.04
|
0.00 – 0.08
|
0.027
|
0.06
|
0.02 – 0.09
|
0.002
|
0.03
|
-0.02 – 0.09
|
0.239
|
|
mental cws
|
0.13
|
0.10 – 0.16
|
<0.001
|
0.18
|
0.15 – 0.20
|
<0.001
|
0.25
|
0.22 – 0.28
|
<0.001
|
0.19
|
0.16 – 0.22
|
<0.001
|
|
brain savg
|
0.02
|
-0.03 – 0.07
|
0.477
|
0.03
|
-0.01 – 0.07
|
0.089
|
|
|
|
|
|
|
|
brain cws
|
0.30
|
0.27 – 0.33
|
<0.001
|
0.33
|
0.30 – 0.36
|
<0.001
|
|
|
|
|
|
|
|
gene savg favg
|
-0.01
|
-0.04 – 0.02
|
0.505
|
|
|
|
-0.01
|
-0.05 – 0.02
|
0.518
|
|
|
|
|
gene cws cwf
|
0.04
|
0.02 – 0.06
|
<0.001
|
|
|
|
0.05
|
0.03 – 0.07
|
<0.001
|
|
|
|
|
sdl savg
|
0.02
|
-0.05 – 0.09
|
0.523
|
|
|
|
|
|
|
0.04
|
-0.01 – 0.09
|
0.156
|
|
sdl cws
|
0.18
|
0.15 – 0.21
|
<0.001
|
|
|
|
|
|
|
0.23
|
0.20 – 0.26
|
<0.001
|
|
Random Effects
|
|
σ2
|
0.36
|
0.37
|
0.40
|
0.41
|
|
τ00
|
0.24 SITE_ID_L:REL_FAMILY_ID
|
0.26 SITE_ID_L:REL_FAMILY_ID
|
0.34 SITE_ID_L:REL_FAMILY_ID
|
0.28 SITE_ID_L:REL_FAMILY_ID
|
|
ICC
|
0.40
|
0.41
|
0.46
|
0.40
|
|
N
|
21 SITE_ID_L
|
21 SITE_ID_L
|
21 SITE_ID_L
|
21 SITE_ID_L
|
|
|
2840 REL_FAMILY_ID
|
2840 REL_FAMILY_ID
|
2840 REL_FAMILY_ID
|
2840 REL_FAMILY_ID
|
|
Observations
|
3321
|
3321
|
3321
|
3321
|
|
Marginal R2 / Conditional R2
|
0.257 / 0.551
|
0.217 / 0.537
|
0.088 / 0.510
|
0.150 / 0.493
|
Baseline percentage
of rsquare plot
overrideTriple=TRUE
quad_venn_baseline_percent <- draw.quad.venn(area1 = baseline_gene_psy_brain_ses_vec_corrected_percent[2]+baseline_gene_psy_brain_ses_vec_corrected_percent[5]+baseline_gene_psy_brain_ses_vec_corrected_percent[7]+baseline_gene_psy_brain_ses_vec_corrected_percent[8]+baseline_gene_psy_brain_ses_vec_corrected_percent[11]+baseline_gene_psy_brain_ses_vec_corrected_percent[13]+baseline_gene_psy_brain_ses_vec_corrected_percent[14]+baseline_gene_psy_brain_ses_vec_corrected_percent[15],
area2 = baseline_gene_psy_brain_ses_vec_corrected_percent[3]+baseline_gene_psy_brain_ses_vec_corrected_percent[5]+baseline_gene_psy_brain_ses_vec_corrected_percent[6]+baseline_gene_psy_brain_ses_vec_corrected_percent[9]+baseline_gene_psy_brain_ses_vec_corrected_percent[11]+baseline_gene_psy_brain_ses_vec_corrected_percent[12]+baseline_gene_psy_brain_ses_vec_corrected_percent[13]+baseline_gene_psy_brain_ses_vec_corrected_percent[15],
area3 = baseline_gene_psy_brain_ses_vec_corrected_percent[1]+baseline_gene_psy_brain_ses_vec_corrected_percent[6]+baseline_gene_psy_brain_ses_vec_corrected_percent[7]+baseline_gene_psy_brain_ses_vec_corrected_percent[10]+baseline_gene_psy_brain_ses_vec_corrected_percent[11]+baseline_gene_psy_brain_ses_vec_corrected_percent[12]+baseline_gene_psy_brain_ses_vec_corrected_percent[14]+baseline_gene_psy_brain_ses_vec_corrected_percent[15],
area4 = baseline_gene_psy_brain_ses_vec_corrected_percent[4]+baseline_gene_psy_brain_ses_vec_corrected_percent[8]+baseline_gene_psy_brain_ses_vec_corrected_percent[9]+baseline_gene_psy_brain_ses_vec_corrected_percent[10]+baseline_gene_psy_brain_ses_vec_corrected_percent[12]+baseline_gene_psy_brain_ses_vec_corrected_percent[13]+baseline_gene_psy_brain_ses_vec_corrected_percent[14]+baseline_gene_psy_brain_ses_vec_corrected_percent[15],
n12 = baseline_gene_psy_brain_ses_vec_corrected_percent[5]+baseline_gene_psy_brain_ses_vec_corrected_percent[11]+baseline_gene_psy_brain_ses_vec_corrected_percent[13]+baseline_gene_psy_brain_ses_vec_corrected_percent[15],
n13 = baseline_gene_psy_brain_ses_vec_corrected_percent[7]+baseline_gene_psy_brain_ses_vec_corrected_percent[11]+baseline_gene_psy_brain_ses_vec_corrected_percent[14]+baseline_gene_psy_brain_ses_vec_corrected_percent[15],
n23 = baseline_gene_psy_brain_ses_vec_corrected_percent[6]+baseline_gene_psy_brain_ses_vec_corrected_percent[11]+baseline_gene_psy_brain_ses_vec_corrected_percent[12]+baseline_gene_psy_brain_ses_vec_corrected_percent[15],
n14 = baseline_gene_psy_brain_ses_vec_corrected_percent[8]+baseline_gene_psy_brain_ses_vec_corrected_percent[13]+baseline_gene_psy_brain_ses_vec_corrected_percent[14]+baseline_gene_psy_brain_ses_vec_corrected_percent[15],
n24 = baseline_gene_psy_brain_ses_vec_corrected_percent[9]+baseline_gene_psy_brain_ses_vec_corrected_percent[12]+baseline_gene_psy_brain_ses_vec_corrected_percent[13]+baseline_gene_psy_brain_ses_vec_corrected_percent[15],
n34 = baseline_gene_psy_brain_ses_vec_corrected_percent[10]+baseline_gene_psy_brain_ses_vec_corrected_percent[12]+baseline_gene_psy_brain_ses_vec_corrected_percent[14]+baseline_gene_psy_brain_ses_vec_corrected_percent[15],
n123 = baseline_gene_psy_brain_ses_vec_corrected_percent[11]+baseline_gene_psy_brain_ses_vec_corrected_percent[15],
n124 = baseline_gene_psy_brain_ses_vec_corrected_percent[13]+baseline_gene_psy_brain_ses_vec_corrected_percent[15],
n134 = baseline_gene_psy_brain_ses_vec_corrected_percent[14]+baseline_gene_psy_brain_ses_vec_corrected_percent[15],
n234 = baseline_gene_psy_brain_ses_vec_corrected_percent[12]+baseline_gene_psy_brain_ses_vec_corrected_percent[15],
n1234 = baseline_gene_psy_brain_ses_vec_corrected_percent[15],
category = c("Brain", "Mental Health", "Genes","Social Demographic Lifestyle"),
fill = c("#009E73", "#D55E00", "#CC79A7","#999999"),
lty = "dashed",
cat.col = c("#009E73", "#D55E00", "#CC79A7","#999999"),
filename = NULL,
cex = 0.001, ## label font size
cat.cex = 2,### caption font size
lwd = 2,
cat.fontface = "bold",
cat.dist = c(0.2, 0.2,0.1,0.1), # Modified
cat.pos = c(1,1,1,1),# Modified
print.mode="percent",
euler.d=F,
scaled=F,
reverse = F,
direct.area=TRUE)

grid.newpage()
#grid::grid.draw(quad_venn_baseline_percent)
#invisible(dev.off())
The plot with label.
#overrideTriple=TRUE
quad_venn_baseline_percent_label <- draw.quad.venn(area1 = baseline_gene_psy_brain_ses_vec_corrected_percent[2]+baseline_gene_psy_brain_ses_vec_corrected_percent[5]+baseline_gene_psy_brain_ses_vec_corrected_percent[7]+baseline_gene_psy_brain_ses_vec_corrected_percent[8]+baseline_gene_psy_brain_ses_vec_corrected_percent[11]+baseline_gene_psy_brain_ses_vec_corrected_percent[13]+baseline_gene_psy_brain_ses_vec_corrected_percent[14]+baseline_gene_psy_brain_ses_vec_corrected_percent[15],
area2 = baseline_gene_psy_brain_ses_vec_corrected_percent[3]+baseline_gene_psy_brain_ses_vec_corrected_percent[5]+baseline_gene_psy_brain_ses_vec_corrected_percent[6]+baseline_gene_psy_brain_ses_vec_corrected_percent[9]+baseline_gene_psy_brain_ses_vec_corrected_percent[11]+baseline_gene_psy_brain_ses_vec_corrected_percent[12]+baseline_gene_psy_brain_ses_vec_corrected_percent[13]+baseline_gene_psy_brain_ses_vec_corrected_percent[15],
area3 = baseline_gene_psy_brain_ses_vec_corrected_percent[1]+baseline_gene_psy_brain_ses_vec_corrected_percent[6]+baseline_gene_psy_brain_ses_vec_corrected_percent[7]+baseline_gene_psy_brain_ses_vec_corrected_percent[10]+baseline_gene_psy_brain_ses_vec_corrected_percent[11]+baseline_gene_psy_brain_ses_vec_corrected_percent[12]+baseline_gene_psy_brain_ses_vec_corrected_percent[14]+baseline_gene_psy_brain_ses_vec_corrected_percent[15],
area4 = baseline_gene_psy_brain_ses_vec_corrected_percent[4]+baseline_gene_psy_brain_ses_vec_corrected_percent[8]+baseline_gene_psy_brain_ses_vec_corrected_percent[9]+baseline_gene_psy_brain_ses_vec_corrected_percent[10]+baseline_gene_psy_brain_ses_vec_corrected_percent[12]+baseline_gene_psy_brain_ses_vec_corrected_percent[13]+baseline_gene_psy_brain_ses_vec_corrected_percent[14]+baseline_gene_psy_brain_ses_vec_corrected_percent[15],
n12 = baseline_gene_psy_brain_ses_vec_corrected_percent[5]+baseline_gene_psy_brain_ses_vec_corrected_percent[11]+baseline_gene_psy_brain_ses_vec_corrected_percent[13]+baseline_gene_psy_brain_ses_vec_corrected_percent[15],
n13 = baseline_gene_psy_brain_ses_vec_corrected_percent[7]+baseline_gene_psy_brain_ses_vec_corrected_percent[11]+baseline_gene_psy_brain_ses_vec_corrected_percent[14]+baseline_gene_psy_brain_ses_vec_corrected_percent[15],
n23 = baseline_gene_psy_brain_ses_vec_corrected_percent[6]+baseline_gene_psy_brain_ses_vec_corrected_percent[11]+baseline_gene_psy_brain_ses_vec_corrected_percent[12]+baseline_gene_psy_brain_ses_vec_corrected_percent[15],
n14 = baseline_gene_psy_brain_ses_vec_corrected_percent[8]+baseline_gene_psy_brain_ses_vec_corrected_percent[13]+baseline_gene_psy_brain_ses_vec_corrected_percent[14]+baseline_gene_psy_brain_ses_vec_corrected_percent[15],
n24 = baseline_gene_psy_brain_ses_vec_corrected_percent[9]+baseline_gene_psy_brain_ses_vec_corrected_percent[12]+baseline_gene_psy_brain_ses_vec_corrected_percent[13]+baseline_gene_psy_brain_ses_vec_corrected_percent[15],
n34 = baseline_gene_psy_brain_ses_vec_corrected_percent[10]+baseline_gene_psy_brain_ses_vec_corrected_percent[12]+baseline_gene_psy_brain_ses_vec_corrected_percent[14]+baseline_gene_psy_brain_ses_vec_corrected_percent[15],
n123 = baseline_gene_psy_brain_ses_vec_corrected_percent[11]+baseline_gene_psy_brain_ses_vec_corrected_percent[15],
n124 = baseline_gene_psy_brain_ses_vec_corrected_percent[13]+baseline_gene_psy_brain_ses_vec_corrected_percent[15],
n134 = baseline_gene_psy_brain_ses_vec_corrected_percent[14]+baseline_gene_psy_brain_ses_vec_corrected_percent[15],
n234 = baseline_gene_psy_brain_ses_vec_corrected_percent[12]+baseline_gene_psy_brain_ses_vec_corrected_percent[15],
n1234 = baseline_gene_psy_brain_ses_vec_corrected_percent[15],
category = c("Brain", "Mental Health", "Genes","Social Demographic Lifestyle"),
fill = c("#009E73", "#D55E00", "#CC79A7","#999999"),
lty = "dashed",
cat.col = c("#009E73", "#D55E00", "#CC79A7","#999999"),
filename = NULL,
cex = 2, ## label font size
cat.cex = 2.5,### caption font size
lwd = 2,
cat.fontface = "bold",
cat.dist = c(0.2, 0.2,0.1,0.1), # Modified
cat.pos = c(1,1,1,1),# Modified
print.mode="percent"
)

grid.newpage()
#grid::grid.draw(quad_venn_baseline_percent_label)
#invisible(dev.off())
The raw r-squared plot.
overrideTriple=TRUE
quad_venn_baseline_raw <- draw.quad.venn(area1 = baseline_gene_psy_brain_ses_vec_corrected_raw[2]+baseline_gene_psy_brain_ses_vec_corrected_raw[5]+baseline_gene_psy_brain_ses_vec_corrected_raw[7]+baseline_gene_psy_brain_ses_vec_corrected_raw[8]+baseline_gene_psy_brain_ses_vec_corrected_raw[11]+baseline_gene_psy_brain_ses_vec_corrected_raw[13]+baseline_gene_psy_brain_ses_vec_corrected_raw[14]+baseline_gene_psy_brain_ses_vec_corrected_raw[15],
area2 = baseline_gene_psy_brain_ses_vec_corrected_raw[3]+baseline_gene_psy_brain_ses_vec_corrected_raw[5]+baseline_gene_psy_brain_ses_vec_corrected_raw[6]+baseline_gene_psy_brain_ses_vec_corrected_raw[9]+baseline_gene_psy_brain_ses_vec_corrected_raw[11]+baseline_gene_psy_brain_ses_vec_corrected_raw[12]+baseline_gene_psy_brain_ses_vec_corrected_raw[13]+baseline_gene_psy_brain_ses_vec_corrected_raw[15],
area3 = baseline_gene_psy_brain_ses_vec_corrected_raw[1]+baseline_gene_psy_brain_ses_vec_corrected_raw[6]+baseline_gene_psy_brain_ses_vec_corrected_raw[7]+baseline_gene_psy_brain_ses_vec_corrected_raw[10]+baseline_gene_psy_brain_ses_vec_corrected_raw[11]+baseline_gene_psy_brain_ses_vec_corrected_raw[12]+baseline_gene_psy_brain_ses_vec_corrected_raw[14]+baseline_gene_psy_brain_ses_vec_corrected_raw[15],
area4 = baseline_gene_psy_brain_ses_vec_corrected_raw[4]+baseline_gene_psy_brain_ses_vec_corrected_raw[8]+baseline_gene_psy_brain_ses_vec_corrected_raw[9]+baseline_gene_psy_brain_ses_vec_corrected_raw[10]+baseline_gene_psy_brain_ses_vec_corrected_raw[12]+baseline_gene_psy_brain_ses_vec_corrected_raw[13]+baseline_gene_psy_brain_ses_vec_corrected_raw[14]+baseline_gene_psy_brain_ses_vec_corrected_raw[15],
n12 = baseline_gene_psy_brain_ses_vec_corrected_raw[5]+baseline_gene_psy_brain_ses_vec_corrected_raw[11]+baseline_gene_psy_brain_ses_vec_corrected_raw[13]+baseline_gene_psy_brain_ses_vec_corrected_raw[15],
n13 = baseline_gene_psy_brain_ses_vec_corrected_raw[7]+baseline_gene_psy_brain_ses_vec_corrected_raw[11]+baseline_gene_psy_brain_ses_vec_corrected_raw[14]+baseline_gene_psy_brain_ses_vec_corrected_raw[15],
n23 = baseline_gene_psy_brain_ses_vec_corrected_raw[6]+baseline_gene_psy_brain_ses_vec_corrected_raw[11]+baseline_gene_psy_brain_ses_vec_corrected_raw[12]+baseline_gene_psy_brain_ses_vec_corrected_raw[15],
n14 = baseline_gene_psy_brain_ses_vec_corrected_raw[8]+baseline_gene_psy_brain_ses_vec_corrected_raw[13]+baseline_gene_psy_brain_ses_vec_corrected_raw[14]+baseline_gene_psy_brain_ses_vec_corrected_raw[15],
n24 = baseline_gene_psy_brain_ses_vec_corrected_raw[9]+baseline_gene_psy_brain_ses_vec_corrected_raw[12]+baseline_gene_psy_brain_ses_vec_corrected_raw[13]+baseline_gene_psy_brain_ses_vec_corrected_raw[15],
n34 = baseline_gene_psy_brain_ses_vec_corrected_raw[10]+baseline_gene_psy_brain_ses_vec_corrected_raw[12]+baseline_gene_psy_brain_ses_vec_corrected_raw[14]+baseline_gene_psy_brain_ses_vec_corrected_raw[15],
n123 = baseline_gene_psy_brain_ses_vec_corrected_raw[11]+baseline_gene_psy_brain_ses_vec_corrected_raw[15],
n124 = baseline_gene_psy_brain_ses_vec_corrected_raw[13]+baseline_gene_psy_brain_ses_vec_corrected_raw[15],
n134 = baseline_gene_psy_brain_ses_vec_corrected_raw[14]+baseline_gene_psy_brain_ses_vec_corrected_raw[15],
n234 = baseline_gene_psy_brain_ses_vec_corrected_raw[12]+baseline_gene_psy_brain_ses_vec_corrected_raw[15],
n1234 = baseline_gene_psy_brain_ses_vec_corrected_raw[15],
category = c("Brain", "Mental Health", "Genes","Social Demographic Lifestyle"),
fill = c("#009E73", "#D55E00", "#CC79A7","#999999"),
lty = "dashed",
cat.col = c("#009E73", "#D55E00", "#CC79A7","#999999"),
filename = NULL,
cex = 0.001, ## label font size
cat.cex = 2,### caption font size
lwd = 2,
cat.fontface = "bold",
cat.dist = c(0.2, 0.2,0.1,0.1), # Modified
cat.pos = c(1,1,1,1),# Modified
print.mode="percent",
euler.d=F,
scaled=F,
reverse = F,
direct.area=TRUE)

grid.newpage()
#grid::grid.draw(quad_venn_baseline_raw)
#invisible(dev.off())
Raw r-square score with label
The following function is changed from the source code of the
package;
The original code is in this page:
https://github.com/cran/VennDiagram/blob/master/R/draw.quad.venn.R
draw.quad.venn_round <- function(
area1,
area2,
area3,
area4,
n12,
n13,
n14,
n23,
n24,
n34,
n123,
n124,
n134,
n234,
n1234,
category = rep('', 4),
lwd = rep(2, 4),
lty = rep('solid', 4),
col = rep('black', 4),
fill = NULL,
alpha = rep(0.5, 4),
label.col = rep('black', 15),
cex = rep(1, 15),
fontface = rep('plain', 15),
fontfamily = rep('serif', 15),
cat.pos = c(-15, 15, 0, 0),
cat.dist = c(0.22, 0.22, 0.11, 0.11),
cat.col = rep('black', 4),
cat.cex = rep(1, 4),
cat.fontface = rep('plain', 4),
cat.fontfamily = rep('serif', 4),
cat.just = rep(list(c(0.5, 0.5)), 4),
rotation.degree = 0,
rotation.centre = c(0.5, 0.5),
ind = TRUE,
cex.prop=NULL,
print.mode = 'raw',
sigdigs=3,
direct.area = FALSE,
area.vector = 0,
...
) {
#area1 > area2 > area3 > area4
# check parameter lengths
if (length(category) == 1) { cat <- rep(category, 4); }
else if (length(category) != 4) { flog.error('Unexpected parameter length for "category"',name='VennDiagramLogger')
stop('Unexpected parameter length for "category"'); }
if (length(lwd) == 1) { lwd <- rep(lwd, 4); }
else if (length(lwd) != 4) { flog.error('Unexpected parameter length for "lwd"',name='VennDiagramLogger')
stop('Unexpected parameter length for "lwd"'); }
if (length(lty) == 1) { lty <- rep(lty, 4); }
else if (length(lty) != 4) { flog.error('Unexpected parameter length for "lty"',name='VennDiagramLogger')
stop('Unexpected parameter length for "lty"'); }
if (length(col) == 1) { col <- rep(col, 4); }
else if (length(col) != 4) { flog.error('Unexpected parameter length for "col"',name='VennDiagramLogger')
stop('Unexpected parameter length for "col"'); }
if (length(label.col) == 1) { label.col <- rep(label.col, 15); }
else if (length(label.col) != 15) { flog.error('Unexpected parameter length for "label.col"',name='VennDiagramLogger')
stop('Unexpected parameter length for "label.col"'); }
if (length(cex) == 1) { cex <- rep(cex, 15); }
else if (length(cex) != 15) { flog.error('Unexpected parameter length for "cex"',name='VennDiagramLogger')
stop('Unexpected parameter length for "cex"'); }
if (length(fontface) == 1) { fontface <- rep(fontface, 15); }
else if (length(fontface) != 15) { flog.error('Unexpected parameter length for "fontface"',name='VennDiagramLogger')
stop('Unexpected parameter length for "fontface"'); }
if (length(fontfamily) == 1) { fontfamily <- rep(fontfamily, 15); }
else if (length(fontfamily) != 15) { flog.error('Unexpected parameter length for "fontfamily"',name='VennDiagramLogger')
stop('Unexpected parameter length for "fontfamily"'); }
if (length(fill) == 1) { fill <- rep(fill, 4); }
else if (length(fill) != 4 & length(fill) != 0) { flog.error('Unexpected parameter length for "fill"',name='VennDiagramLogger')
stop('Unexpected parameter length for "fill"'); }
if (length(alpha) == 1) { alpha <- rep(alpha, 4); }
else if (length(alpha) != 4 & length(alpha) != 0) { flog.error('Unexpected parameter length for "alpha"',name='VennDiagramLogger')
stop('Unexpected parameter length for "alpha"'); }
if (length(cat.pos) == 1) { cat.pos <- rep(cat.pos, 4); }
else if (length(cat.pos) != 4) { flog.error('Unexpected parameter length for "cat.pos"',name='VennDiagramLogger')
stop('Unexpected parameter length for "cat.pos"'); }
if (length(cat.dist) == 1) { cat.dist <- rep(cat.dist, 4); }
else if (length(cat.dist) != 4) { flog.error('Unexpected parameter length for "cat.dist"',name='VennDiagramLogger')
stop('Unexpected parameter length for "cat.dist"'); }
if (length(cat.col) == 1) { cat.col <- rep(cat.col, 4); }
else if (length(cat.col) != 4) { flog.error('Unexpected parameter length for "cat.col"',name='VennDiagramLogger')
stop('Unexpected parameter length for "cat.col"'); }
if (length(cat.cex) == 1) { cat.cex <- rep(cat.cex, 4); }
else if (length(cat.cex) != 4) { flog.error('Unexpected parameter length for "cat.cex"',name='VennDiagramLogger')
stop('Unexpected parameter length for "cat.cex"'); }
if (length(cat.fontface) == 1) { cat.fontface <- rep(cat.fontface, 4); }
else if (length(cat.fontface) != 4) { flog.error('Unexpected parameter length for "cat.fontface"',name='VennDiagramLogger')
stop('Unexpected parameter length for "cat.fontface"'); }
if (length(cat.fontfamily) == 1) { cat.fontfamily <- rep(cat.fontfamily, 4); }
else if (length(cat.fontfamily) != 4) { flog.error('Unexpected parameter length for "cat.fontfamily"',name='VennDiagramLogger')
stop('Unexpected parameter length for "cat.fontfamily"'); }
if (!(is.list(cat.just) && length(cat.just) == 4 && length(cat.just[[1]]) == 2 && length(cat.just[[2]]) == 2 && length(cat.just[[3]]) == 2 && length(cat.just[[4]]) == 2)) { flog.error('Unexpected parameter format for "cat.just"',name='VennDiagramLogger')
stop('Unexpected parameter format for "cat.just"'); }
cat.pos <- cat.pos + rotation.degree;
if(direct.area){
areas <- area.vector;
#create the variables and assign their values from the area vector
for(i in 1:15)
{
assign(paste('a',i,sep=''),area.vector[i]);
}
}
else {
# generate partial areas from given arguments
a6 <- round(n1234,2);
a12 <- round(n123 - a6,2);
a11 <- round(n124 - a6,2);
a5 <- round(n134 - a6,2);
a7 <- round(n234 - a6,2);
a15 <- round(n12 - a6 - a11 - a12,2);
a4 <- round(n13 - a6 - a5 - a12,2);
a10 <- round(n14 - a6 - a5 - a11,2);
a13 <- round(n23 - a6 - a7 - a12,2);
a8 <- round(n24 - a6 - a7 - a11,2);
a2 <- round(n34 - a6 - a5 - a7,2);
a9 <- round(area1 - a4 - a5 - a6 - a10 - a11 - a12 - a15,2);
a14 <- round(area2 - a6 - a7 - a8 - a11 - a12 - a13 - a15,2);
a1 <- round(area3 - a2 - a4 - a5 - a6 - a7 - a12 - a13,2);
a3 <- round(area4 - a2 - a5 - a6 - a7 - a8 - a10 - a11,2);
# check plausibility and 0 partial areas
areas <- c(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15);
}
areas.error <- c(
'a1 <- area3 - a2 - a4 - a5 - a6 - a7 - a12 - a13',
'a2 <- n34 - a6 - a5 - a7',
'a3 <- area4 - a2 - a5 - a6 - a7 - a8 - a10 - a11',
'a4 <- n13 - a6 - a5 - a12',
'a5 <- n134 - a6',
'a6 <- n1234',
'a7 <- n234 - a6',
'a8 <- n24 - a6 - a7 - a11',
'a9 <- area1 - a4 - a5 - a6 - a10 - a11 - a12 - a15',
'a10 <- n14 - a6 - a5 - a11',
'a11 <- n124 - a6',
'a12 <- n123 - a6',
'a15 <- n12 - a6 - a11 - a12',
'a13 <- n23 - a6 - a7 - a12',
'a14 <- area2 - a6 - a7 - a8 - a11 - a12 - a13 - a15'
);
for (i in 1:length(areas)) {
if (areas[i] < 0) {
flog.error(paste('Impossible:', areas.error[i], 'produces negative area'),name='VennDiagramLogger')
stop(paste('Impossible:', areas.error[i], 'produces negative area'));
}
}
## rescaling area labels to be proportional to area
if(length(cex.prop) > 0){
if(length(cex.prop) != 1) {
flog.error('Value passed to cex.prop is not length 1',name='VennDiagramLogger')
stop('Value passed to cex.prop is not length 1')
}
## figure out what function to use
func = cex.prop
if (!is(cex.prop, 'function')) {
if(cex.prop == 'lin'){
func = function(x) x
}
else if(cex.prop == 'log10'){
func = log10
}
else flog.error(paste0('Unknown value passed to cex.prop: ', cex.prop),name='VennDiagramLogger')
stop(paste0('Unknown value passed to cex.prop: ', cex.prop))
}
## rescale areas
maxArea = max(areas)
for(i in 1:length(areas)){
cex[i] = cex[i] * func(areas[i]) / func(maxArea)
if(cex[i] <= 0) stop(paste0('Error in rescaling of area labels: the label of area ',
i, ' is less than or equal to zero'))
}
}
# initialize gList to hold all Grobs generated
grob.list <- gList();
# plot the ellipses of the Venn diagram
ellipse.positions <- matrix(
nrow = 4,
ncol = 7
);
colnames(ellipse.positions) <- c('x', 'y', 'a', 'b', 'rotation', 'fill.mapping', 'line.mapping');
ellipse.positions[1,] <- c(0.65, 0.47, 0.35, 0.20, 45, 2, 2);
ellipse.positions[2,] <- c(0.35, 0.47, 0.35, 0.20, 135, 1, 1);
ellipse.positions[3,] <- c(0.50, 0.57, 0.33, 0.15, 45, 4, 4);
ellipse.positions[4,] <- c(0.50, 0.57, 0.35, 0.15, 135, 3, 3);
# draw the ellipses themselves
for (i in 1:4) {
grob.list <- gList(
grob.list,
VennDiagram::ellipse(
x = ellipse.positions[i,'x'],
y = ellipse.positions[i,'y'],
a = ellipse.positions[i,'a'],
b = ellipse.positions[i,'b'],
rotation = ellipse.positions[i, 'rotation'],
gp = gpar(
lty = 0,
fill = fill[ellipse.positions[i,'fill.mapping']],
alpha = alpha[ellipse.positions[i,'fill.mapping']]
)
)
);
}
# draw the ellipse borders
for (i in 1:4) {
grob.list <- gList(
grob.list,
ellipse(
x = ellipse.positions[i,'x'],
y = ellipse.positions[i,'y'],
a = ellipse.positions[i,'a'],
b = ellipse.positions[i,'b'],
rotation = ellipse.positions[i, 'rotation'],
gp = gpar(
lwd = lwd[ellipse.positions[i,'line.mapping']],
lty = lty[ellipse.positions[i,'line.mapping']],
col = col[ellipse.positions[i,'line.mapping']],
fill = 'transparent'
)
)
);
}
# create the labels
label.matrix <- matrix(
nrow = 15,
ncol = 3
);
colnames(label.matrix) <- c('label', 'x', 'y');
label.matrix[ 1,] <- c(a1, 0.350, 0.77);
label.matrix[ 2,] <- c(a2, 0.500, 0.69);
label.matrix[ 3,] <- c(a3, 0.650, 0.77);
label.matrix[ 4,] <- c(a4, 0.310, 0.67);
label.matrix[ 5,] <- c(a5, 0.400, 0.58);
label.matrix[ 6,] <- c(a6, 0.500, 0.47);
label.matrix[ 7,] <- c(a7, 0.600, 0.58);
label.matrix[ 8,] <- c(a8, 0.690, 0.67);
label.matrix[ 9,] <- c(a9, 0.180, 0.58);
label.matrix[10,] <- c(a10, 0.320, 0.42);
label.matrix[11,] <- c(a11, 0.425, 0.38);
label.matrix[12,] <- c(a12, 0.575, 0.38);
label.matrix[13,] <- c(a13, 0.680, 0.42);
label.matrix[14,] <- c(a14, 0.820, 0.58);
label.matrix[15,] <- c(a15, 0.500, 0.28);
processedLabels <- rep('',length(label.matrix[,'label']));
if(print.mode[1] == 'percent'){
processedLabels <- paste(signif(label.matrix[,'label']/sum(label.matrix[,'label'])*100,digits=sigdigs),'%',sep='');
if(isTRUE(print.mode[2] == 'raw'))
{
processedLabels <- paste(processedLabels,'\n(',label.matrix[,'label'],')',sep='');
}
}
if(print.mode[1] == 'raw'){
processedLabels <- label.matrix[,'label'];
if(isTRUE(print.mode[2] == 'percent'))
{
processedLabels <- paste(processedLabels,'\n(',paste(signif(label.matrix[,'label']/sum(label.matrix[,'label'])*100,digits=sigdigs),'%)',sep=''),sep='');
}
}
for (i in 1:nrow(label.matrix)) {
grob.list <- gList(
grob.list,
textGrob(
label = processedLabels[i],
x = label.matrix[i,'x'],
y = label.matrix[i,'y'],
gp = gpar(
col = label.col[i],
cex = cex[i],
fontface = fontface[i],
fontfamily = fontfamily[i]
)
)
);
}
# find the location and plot all the category names
cat.pos.x <- c(0.18, 0.82, 0.35, 0.65);
cat.pos.y <- c(0.58, 0.58, 0.77, 0.77);
for (i in 1:4) {
# work out location of the category label
this.cat.pos <- find.cat.pos(
x = cat.pos.x[i],
y = cat.pos.y[i],
pos = cat.pos[i],
dist = cat.dist[i]
);
# then print it
grob.list <- gList(
grob.list,
textGrob(
label = category[i],
x = this.cat.pos$x,
y = this.cat.pos$y,
just = cat.just[[i]],
gp = gpar(
col = cat.col[i],
cex = cat.cex[i],
fontface = cat.fontface[i],
fontfamily = cat.fontfamily[i]
)
)
);
}
# adjust grob.list to fit and return grob.list
grob.list <- VennDiagram::adjust.venn(VennDiagram::rotate.venn.degrees(grob.list, rotation.degree, rotation.centre[1], rotation.centre[2]), ...);
# draw diagram before returning gList is specified by user
if (ind) { grid.draw(grob.list); }
return(grob.list);
}
#overrideTriple=TRUE
quad_venn_baseline_raw_label <- draw.quad.venn_round(area1 = baseline_gene_psy_brain_ses_vec_corrected_raw[2]+baseline_gene_psy_brain_ses_vec_corrected_raw[5]+baseline_gene_psy_brain_ses_vec_corrected_raw[7]+baseline_gene_psy_brain_ses_vec_corrected_raw[8]+baseline_gene_psy_brain_ses_vec_corrected_raw[11]+baseline_gene_psy_brain_ses_vec_corrected_raw[13]+baseline_gene_psy_brain_ses_vec_corrected_raw[14]+baseline_gene_psy_brain_ses_vec_corrected_raw[15],
area2 = baseline_gene_psy_brain_ses_vec_corrected_raw[3]+baseline_gene_psy_brain_ses_vec_corrected_raw[5]+baseline_gene_psy_brain_ses_vec_corrected_raw[6]+baseline_gene_psy_brain_ses_vec_corrected_raw[9]+baseline_gene_psy_brain_ses_vec_corrected_raw[11]+baseline_gene_psy_brain_ses_vec_corrected_raw[12]+baseline_gene_psy_brain_ses_vec_corrected_raw[13]+baseline_gene_psy_brain_ses_vec_corrected_raw[15],
area3 = baseline_gene_psy_brain_ses_vec_corrected_raw[1]+baseline_gene_psy_brain_ses_vec_corrected_raw[6]+baseline_gene_psy_brain_ses_vec_corrected_raw[7]+baseline_gene_psy_brain_ses_vec_corrected_raw[10]+baseline_gene_psy_brain_ses_vec_corrected_raw[11]+baseline_gene_psy_brain_ses_vec_corrected_raw[12]+baseline_gene_psy_brain_ses_vec_corrected_raw[14]+baseline_gene_psy_brain_ses_vec_corrected_raw[15],
area4 = baseline_gene_psy_brain_ses_vec_corrected_raw[4]+baseline_gene_psy_brain_ses_vec_corrected_raw[8]+baseline_gene_psy_brain_ses_vec_corrected_raw[9]+baseline_gene_psy_brain_ses_vec_corrected_raw[10]+baseline_gene_psy_brain_ses_vec_corrected_raw[12]+baseline_gene_psy_brain_ses_vec_corrected_raw[13]+baseline_gene_psy_brain_ses_vec_corrected_raw[14]+baseline_gene_psy_brain_ses_vec_corrected_raw[15],
n12 = baseline_gene_psy_brain_ses_vec_corrected_raw[5]+baseline_gene_psy_brain_ses_vec_corrected_raw[11]+baseline_gene_psy_brain_ses_vec_corrected_raw[13]+baseline_gene_psy_brain_ses_vec_corrected_raw[15],
n13 = baseline_gene_psy_brain_ses_vec_corrected_raw[7]+baseline_gene_psy_brain_ses_vec_corrected_raw[11]+baseline_gene_psy_brain_ses_vec_corrected_raw[14]+baseline_gene_psy_brain_ses_vec_corrected_raw[15],
n23 = baseline_gene_psy_brain_ses_vec_corrected_raw[6]+baseline_gene_psy_brain_ses_vec_corrected_raw[11]+baseline_gene_psy_brain_ses_vec_corrected_raw[12]+baseline_gene_psy_brain_ses_vec_corrected_raw[15],
n14 = baseline_gene_psy_brain_ses_vec_corrected_raw[8]+baseline_gene_psy_brain_ses_vec_corrected_raw[13]+baseline_gene_psy_brain_ses_vec_corrected_raw[14]+baseline_gene_psy_brain_ses_vec_corrected_raw[15],
n24 = baseline_gene_psy_brain_ses_vec_corrected_raw[9]+baseline_gene_psy_brain_ses_vec_corrected_raw[12]+baseline_gene_psy_brain_ses_vec_corrected_raw[13]+baseline_gene_psy_brain_ses_vec_corrected_raw[15],
n34 = baseline_gene_psy_brain_ses_vec_corrected_raw[10]+baseline_gene_psy_brain_ses_vec_corrected_raw[12]+baseline_gene_psy_brain_ses_vec_corrected_raw[14]+baseline_gene_psy_brain_ses_vec_corrected_raw[15],
n123 =baseline_gene_psy_brain_ses_vec_corrected_raw[11]+baseline_gene_psy_brain_ses_vec_corrected_raw[15],
n124 = baseline_gene_psy_brain_ses_vec_corrected_raw[13]+baseline_gene_psy_brain_ses_vec_corrected_raw[15],
n134 = baseline_gene_psy_brain_ses_vec_corrected_raw[14]+baseline_gene_psy_brain_ses_vec_corrected_raw[15],
n234 = baseline_gene_psy_brain_ses_vec_corrected_raw[12]+baseline_gene_psy_brain_ses_vec_corrected_raw[15],
n1234 = baseline_gene_psy_brain_ses_vec_corrected_raw[15],
category = c("Brain", "Mental \nHealth", "Genes","Socio-Demo \nLifestyle Dev"),
fill = c("#009E73", "#D55E00", "#CC79A7","#999999"),
lty = "dashed",
cat.col = c("#009E73", "#D55E00", "#CC79A7","#999999"),
filename = NULL,
cex = 2, ## label font size
cat.cex = 2,### caption font size
lwd = 2,
cat.fontface = "bold",
cat.dist = c(0.2, 0.25,0.1,0.13), # Modified
cat.pos = c(-5,10,1,-13),# Modified
#print.mode="percent"
)

grid.newpage()
#grid::grid.draw(quad_venn_baseline_raw_label)
#invisible(dev.off())
followup percentage
of rsquare plot
overrideTriple=TRUE
quad_venn_followup_percent <- draw.quad.venn(area1 = followup_gene_psy_brain_ses_vec_corrected_percentage[2]+followup_gene_psy_brain_ses_vec_corrected_percentage[5]+followup_gene_psy_brain_ses_vec_corrected_percentage[7]+followup_gene_psy_brain_ses_vec_corrected_percentage[8]+followup_gene_psy_brain_ses_vec_corrected_percentage[11]+followup_gene_psy_brain_ses_vec_corrected_percentage[13]+followup_gene_psy_brain_ses_vec_corrected_percentage[14]+followup_gene_psy_brain_ses_vec_corrected_percentage[15],
area2 = followup_gene_psy_brain_ses_vec_corrected_percentage[3]+followup_gene_psy_brain_ses_vec_corrected_percentage[5]+followup_gene_psy_brain_ses_vec_corrected_percentage[6]+followup_gene_psy_brain_ses_vec_corrected_percentage[9]+followup_gene_psy_brain_ses_vec_corrected_percentage[11]+followup_gene_psy_brain_ses_vec_corrected_percentage[12]+followup_gene_psy_brain_ses_vec_corrected_percentage[13]+followup_gene_psy_brain_ses_vec_corrected_percentage[15],
area3 = followup_gene_psy_brain_ses_vec_corrected_percentage[1]+followup_gene_psy_brain_ses_vec_corrected_percentage[6]+followup_gene_psy_brain_ses_vec_corrected_percentage[7]+followup_gene_psy_brain_ses_vec_corrected_percentage[10]+followup_gene_psy_brain_ses_vec_corrected_percentage[11]+followup_gene_psy_brain_ses_vec_corrected_percentage[12]+followup_gene_psy_brain_ses_vec_corrected_percentage[14]+followup_gene_psy_brain_ses_vec_corrected_percentage[15],
area4 = followup_gene_psy_brain_ses_vec_corrected_percentage[4]+followup_gene_psy_brain_ses_vec_corrected_percentage[8]+followup_gene_psy_brain_ses_vec_corrected_percentage[9]+followup_gene_psy_brain_ses_vec_corrected_percentage[10]+followup_gene_psy_brain_ses_vec_corrected_percentage[12]+followup_gene_psy_brain_ses_vec_corrected_percentage[13]+followup_gene_psy_brain_ses_vec_corrected_percentage[14]+followup_gene_psy_brain_ses_vec_corrected_percentage[15],
n12 = followup_gene_psy_brain_ses_vec_corrected_percentage[5]+followup_gene_psy_brain_ses_vec_corrected_percentage[11]+followup_gene_psy_brain_ses_vec_corrected_percentage[13]+followup_gene_psy_brain_ses_vec_corrected_percentage[15],
n13 = followup_gene_psy_brain_ses_vec_corrected_percentage[7]+followup_gene_psy_brain_ses_vec_corrected_percentage[11]+followup_gene_psy_brain_ses_vec_corrected_percentage[14]+followup_gene_psy_brain_ses_vec_corrected_percentage[15],
n23 = followup_gene_psy_brain_ses_vec_corrected_percentage[6]+followup_gene_psy_brain_ses_vec_corrected_percentage[11]+followup_gene_psy_brain_ses_vec_corrected_percentage[12]+followup_gene_psy_brain_ses_vec_corrected_percentage[15],
n14 = followup_gene_psy_brain_ses_vec_corrected_percentage[8]+followup_gene_psy_brain_ses_vec_corrected_percentage[13]+followup_gene_psy_brain_ses_vec_corrected_percentage[14]+followup_gene_psy_brain_ses_vec_corrected_percentage[15],
n24 = followup_gene_psy_brain_ses_vec_corrected_percentage[9]+followup_gene_psy_brain_ses_vec_corrected_percentage[12]+followup_gene_psy_brain_ses_vec_corrected_percentage[13]+followup_gene_psy_brain_ses_vec_corrected_percentage[15],
n34 = followup_gene_psy_brain_ses_vec_corrected_percentage[10]+followup_gene_psy_brain_ses_vec_corrected_percentage[12]+followup_gene_psy_brain_ses_vec_corrected_percentage[14]+followup_gene_psy_brain_ses_vec_corrected_percentage[15],
n123 = followup_gene_psy_brain_ses_vec_corrected_percentage[11]+followup_gene_psy_brain_ses_vec_corrected_percentage[15],
n124 = followup_gene_psy_brain_ses_vec_corrected_percentage[13]+followup_gene_psy_brain_ses_vec_corrected_percentage[15],
n134 = followup_gene_psy_brain_ses_vec_corrected_percentage[14]+followup_gene_psy_brain_ses_vec_corrected_percentage[15],
n234 = followup_gene_psy_brain_ses_vec_corrected_percentage[12]+followup_gene_psy_brain_ses_vec_corrected_percentage[15],
n1234 = followup_gene_psy_brain_ses_vec_corrected_percentage[15],
category = c("Brain", "Mental Health", "Genes","Social Demographic Lifestyle"),
fill = c("#009E73", "#D55E00", "#CC79A7","#999999"),
lty = "dashed",
cat.col = c("#009E73", "#D55E00", "#CC79A7","#999999"),
filename = NULL,
cex = 0.001, ## label font size
cat.cex = 2,### caption font size
lwd = 2,
cat.fontface = "bold",
cat.dist = c(0.2, 0.2,0.1,0.1), # Modified
cat.pos = c(1,1,1,1),# Modified
print.mode="percent",
euler.d=F,
scaled=F,
reverse = F,
direct.area=TRUE)

grid.newpage()
#grid::grid.draw(quad_venn_followup_percent)
#invisible(dev.off())
#overrideTriple=TRUE
quad_venn_followup_percent_label <- draw.quad.venn(area1 = followup_gene_psy_brain_ses_vec_corrected_percentage[2]+followup_gene_psy_brain_ses_vec_corrected_percentage[5]+followup_gene_psy_brain_ses_vec_corrected_percentage[7]+followup_gene_psy_brain_ses_vec_corrected_percentage[8]+followup_gene_psy_brain_ses_vec_corrected_percentage[11]+followup_gene_psy_brain_ses_vec_corrected_percentage[13]+followup_gene_psy_brain_ses_vec_corrected_percentage[14]+followup_gene_psy_brain_ses_vec_corrected_percentage[15],
area2 = followup_gene_psy_brain_ses_vec_corrected_percentage[3]+followup_gene_psy_brain_ses_vec_corrected_percentage[5]+followup_gene_psy_brain_ses_vec_corrected_percentage[6]+followup_gene_psy_brain_ses_vec_corrected_percentage[9]+followup_gene_psy_brain_ses_vec_corrected_percentage[11]+followup_gene_psy_brain_ses_vec_corrected_percentage[12]+followup_gene_psy_brain_ses_vec_corrected_percentage[13]+followup_gene_psy_brain_ses_vec_corrected_percentage[15],
area3 = followup_gene_psy_brain_ses_vec_corrected_percentage[1]+followup_gene_psy_brain_ses_vec_corrected_percentage[6]+followup_gene_psy_brain_ses_vec_corrected_percentage[7]+followup_gene_psy_brain_ses_vec_corrected_percentage[10]+followup_gene_psy_brain_ses_vec_corrected_percentage[11]+followup_gene_psy_brain_ses_vec_corrected_percentage[12]+followup_gene_psy_brain_ses_vec_corrected_percentage[14]+followup_gene_psy_brain_ses_vec_corrected_percentage[15],
area4 = followup_gene_psy_brain_ses_vec_corrected_percentage[4]+followup_gene_psy_brain_ses_vec_corrected_percentage[8]+followup_gene_psy_brain_ses_vec_corrected_percentage[9]+followup_gene_psy_brain_ses_vec_corrected_percentage[10]+followup_gene_psy_brain_ses_vec_corrected_percentage[12]+followup_gene_psy_brain_ses_vec_corrected_percentage[13]+followup_gene_psy_brain_ses_vec_corrected_percentage[14]+followup_gene_psy_brain_ses_vec_corrected_percentage[15],
n12 = followup_gene_psy_brain_ses_vec_corrected_percentage[5]+followup_gene_psy_brain_ses_vec_corrected_percentage[11]+followup_gene_psy_brain_ses_vec_corrected_percentage[13]+followup_gene_psy_brain_ses_vec_corrected_percentage[15],
n13 = followup_gene_psy_brain_ses_vec_corrected_percentage[7]+followup_gene_psy_brain_ses_vec_corrected_percentage[11]+followup_gene_psy_brain_ses_vec_corrected_percentage[14]+followup_gene_psy_brain_ses_vec_corrected_percentage[15],
n23 = followup_gene_psy_brain_ses_vec_corrected_percentage[6]+followup_gene_psy_brain_ses_vec_corrected_percentage[11]+followup_gene_psy_brain_ses_vec_corrected_percentage[12]+followup_gene_psy_brain_ses_vec_corrected_percentage[15],
n14 = followup_gene_psy_brain_ses_vec_corrected_percentage[8]+followup_gene_psy_brain_ses_vec_corrected_percentage[13]+followup_gene_psy_brain_ses_vec_corrected_percentage[14]+followup_gene_psy_brain_ses_vec_corrected_percentage[15],
n24 = followup_gene_psy_brain_ses_vec_corrected_percentage[9]+followup_gene_psy_brain_ses_vec_corrected_percentage[12]+followup_gene_psy_brain_ses_vec_corrected_percentage[13]+followup_gene_psy_brain_ses_vec_corrected_percentage[15],
n34 = followup_gene_psy_brain_ses_vec_corrected_percentage[10]+followup_gene_psy_brain_ses_vec_corrected_percentage[12]+followup_gene_psy_brain_ses_vec_corrected_percentage[14]+followup_gene_psy_brain_ses_vec_corrected_percentage[15],
n123 = followup_gene_psy_brain_ses_vec_corrected_percentage[11]+followup_gene_psy_brain_ses_vec_corrected_percentage[15],
n124 = followup_gene_psy_brain_ses_vec_corrected_percentage[13]+followup_gene_psy_brain_ses_vec_corrected_percentage[15],
n134 = followup_gene_psy_brain_ses_vec_corrected_percentage[14]+followup_gene_psy_brain_ses_vec_corrected_percentage[15],
n234 = followup_gene_psy_brain_ses_vec_corrected_percentage[12]+followup_gene_psy_brain_ses_vec_corrected_percentage[15],
n1234 = followup_gene_psy_brain_ses_vec_corrected_percentage[15],
category = c("Brain", "Mental Health", "Genes","Social Demographic Lifestyle"),
fill = c("#009E73", "#D55E00", "#CC79A7","#999999"),
lty = "dashed",
cat.col = c("#009E73", "#D55E00", "#CC79A7","#999999"),
filename = NULL,
cex = 2, ## label font size
cat.cex = 2.5,### caption font size
lwd = 2,
cat.fontface = "bold",
cat.dist = c(0.2, 0.2,0.1,0.1), # Modified
cat.pos = c(1,1,1,1),# Modified
print.mode="percent"
)

grid.newpage()
#grid::grid.draw(quad_venn_followup_percent_label)
#invisible(dev.off())
The raw R-squared plot
overrideTriple=TRUE
quad_venn_followup_raw <- draw.quad.venn(area1 = followup_gene_psy_brain_ses_vec_corrected_raw[2]+followup_gene_psy_brain_ses_vec_corrected_raw[5]+followup_gene_psy_brain_ses_vec_corrected_raw[7]+followup_gene_psy_brain_ses_vec_corrected_raw[8]+followup_gene_psy_brain_ses_vec_corrected_raw[11]+followup_gene_psy_brain_ses_vec_corrected_raw[13]+followup_gene_psy_brain_ses_vec_corrected_raw[14]+followup_gene_psy_brain_ses_vec_corrected_raw[15],
area2 = followup_gene_psy_brain_ses_vec_corrected_raw[3]+followup_gene_psy_brain_ses_vec_corrected_raw[5]+followup_gene_psy_brain_ses_vec_corrected_raw[6]+followup_gene_psy_brain_ses_vec_corrected_raw[9]+baseline_gene_psy_brain_ses_vec_corrected_raw[11]+followup_gene_psy_brain_ses_vec_corrected_raw[12]+followup_gene_psy_brain_ses_vec_corrected_raw[13]+followup_gene_psy_brain_ses_vec_corrected_raw[15],
area3 = followup_gene_psy_brain_ses_vec_corrected_raw[1]+followup_gene_psy_brain_ses_vec_corrected_raw[6]+followup_gene_psy_brain_ses_vec_corrected_raw[7]+followup_gene_psy_brain_ses_vec_corrected_raw[10]+followup_gene_psy_brain_ses_vec_corrected_raw[11]+followup_gene_psy_brain_ses_vec_corrected_raw[12]+followup_gene_psy_brain_ses_vec_corrected_raw[14]+followup_gene_psy_brain_ses_vec_corrected_raw[15],
area4 = followup_gene_psy_brain_ses_vec_corrected_raw[4]+followup_gene_psy_brain_ses_vec_corrected_raw[8]+followup_gene_psy_brain_ses_vec_corrected_raw[9]+followup_gene_psy_brain_ses_vec_corrected_raw[10]+baseline_gene_psy_brain_ses_vec_corrected_raw[12]+followup_gene_psy_brain_ses_vec_corrected_raw[13]+baseline_gene_psy_brain_ses_vec_corrected_raw[14]+followup_gene_psy_brain_ses_vec_corrected_raw[15],
n12 = followup_gene_psy_brain_ses_vec_corrected_raw[5]+followup_gene_psy_brain_ses_vec_corrected_raw[11]+followup_gene_psy_brain_ses_vec_corrected_raw[13]+followup_gene_psy_brain_ses_vec_corrected_raw[15],
n13 = followup_gene_psy_brain_ses_vec_corrected_raw[7]+followup_gene_psy_brain_ses_vec_corrected_raw[11]+followup_gene_psy_brain_ses_vec_corrected_raw[14]+followup_gene_psy_brain_ses_vec_corrected_raw[15],
n23 = followup_gene_psy_brain_ses_vec_corrected_raw[6]+followup_gene_psy_brain_ses_vec_corrected_raw[11]+followup_gene_psy_brain_ses_vec_corrected_raw[12]+followup_gene_psy_brain_ses_vec_corrected_raw[15],
n14 = followup_gene_psy_brain_ses_vec_corrected_raw[8]+followup_gene_psy_brain_ses_vec_corrected_raw[13]+followup_gene_psy_brain_ses_vec_corrected_raw[14]+followup_gene_psy_brain_ses_vec_corrected_raw[15],
n24 = followup_gene_psy_brain_ses_vec_corrected_raw[9]+followup_gene_psy_brain_ses_vec_corrected_raw[12]+followup_gene_psy_brain_ses_vec_corrected_raw[13]+followup_gene_psy_brain_ses_vec_corrected_raw[15],
n34 = followup_gene_psy_brain_ses_vec_corrected_raw[10]+followup_gene_psy_brain_ses_vec_corrected_raw[12]+followup_gene_psy_brain_ses_vec_corrected_raw[14]+followup_gene_psy_brain_ses_vec_corrected_raw[15],
n123 = followup_gene_psy_brain_ses_vec_corrected_raw[11]+followup_gene_psy_brain_ses_vec_corrected_raw[15],
n124 = followup_gene_psy_brain_ses_vec_corrected_raw[13]+followup_gene_psy_brain_ses_vec_corrected_raw[15],
n134 = followup_gene_psy_brain_ses_vec_corrected_raw[14]+followup_gene_psy_brain_ses_vec_corrected_raw[15],
n234 = followup_gene_psy_brain_ses_vec_corrected_raw[12]+followup_gene_psy_brain_ses_vec_corrected_raw[15],
n1234 = followup_gene_psy_brain_ses_vec_corrected_raw[15],
category = c("Brain", "Mental \nHealth", "Genes","Socio-Demo \nLifestyle Dev"),
fill = c("#009E73", "#D55E00", "#CC79A7","#999999"),
lty = "dashed",
cat.col = c("#009E73", "#D55E00", "#CC79A7","#999999"),
filename = NULL,
cex = 0.001, ## label font size
cat.cex = 2,### caption font size
lwd = 2,
cat.fontface = "bold",
cat.dist = c(0.2, 0.2,0.1,0.1), # Modified
cat.pos = c(1,1,1,1),# Modified
print.mode="percent",
euler.d=F,
scaled=F,
reverse = F,
direct.area=TRUE)

grid.newpage()
#grid::grid.draw(quad_venn_followup_raw)
#invisible(dev.off())
#overrideTriple=TRUE
quad_venn_followup_raw_label <- draw.quad.venn_round(area1 = followup_gene_psy_brain_ses_vec_corrected_raw[2]+followup_gene_psy_brain_ses_vec_corrected_raw[5]+followup_gene_psy_brain_ses_vec_corrected_raw[7]+followup_gene_psy_brain_ses_vec_corrected_raw[8]+followup_gene_psy_brain_ses_vec_corrected_raw[11]+followup_gene_psy_brain_ses_vec_corrected_raw[13]+followup_gene_psy_brain_ses_vec_corrected_raw[14]+followup_gene_psy_brain_ses_vec_corrected_raw[15],
area2 = followup_gene_psy_brain_ses_vec_corrected_raw[3]+followup_gene_psy_brain_ses_vec_corrected_raw[5]+followup_gene_psy_brain_ses_vec_corrected_raw[6]+followup_gene_psy_brain_ses_vec_corrected_raw[9]+baseline_gene_psy_brain_ses_vec_corrected_raw[11]+followup_gene_psy_brain_ses_vec_corrected_raw[12]+followup_gene_psy_brain_ses_vec_corrected_raw[13]+followup_gene_psy_brain_ses_vec_corrected_raw[15],
area3 = followup_gene_psy_brain_ses_vec_corrected_raw[1]+followup_gene_psy_brain_ses_vec_corrected_raw[6]+followup_gene_psy_brain_ses_vec_corrected_raw[7]+followup_gene_psy_brain_ses_vec_corrected_raw[10]+followup_gene_psy_brain_ses_vec_corrected_raw[11]+followup_gene_psy_brain_ses_vec_corrected_raw[12]+followup_gene_psy_brain_ses_vec_corrected_raw[14]+followup_gene_psy_brain_ses_vec_corrected_raw[15],
area4 = followup_gene_psy_brain_ses_vec_corrected_raw[4]+followup_gene_psy_brain_ses_vec_corrected_raw[8]+followup_gene_psy_brain_ses_vec_corrected_raw[9]+followup_gene_psy_brain_ses_vec_corrected_raw[10]+baseline_gene_psy_brain_ses_vec_corrected_raw[12]+followup_gene_psy_brain_ses_vec_corrected_raw[13]+baseline_gene_psy_brain_ses_vec_corrected_raw[14]+followup_gene_psy_brain_ses_vec_corrected_raw[15],
n12 = followup_gene_psy_brain_ses_vec_corrected_raw[5]+followup_gene_psy_brain_ses_vec_corrected_raw[11]+followup_gene_psy_brain_ses_vec_corrected_raw[13]+followup_gene_psy_brain_ses_vec_corrected_raw[15],
n13 = followup_gene_psy_brain_ses_vec_corrected_raw[7]+followup_gene_psy_brain_ses_vec_corrected_raw[11]+followup_gene_psy_brain_ses_vec_corrected_raw[14]+followup_gene_psy_brain_ses_vec_corrected_raw[15],
n23 = followup_gene_psy_brain_ses_vec_corrected_raw[6]+followup_gene_psy_brain_ses_vec_corrected_raw[11]+followup_gene_psy_brain_ses_vec_corrected_raw[12]+followup_gene_psy_brain_ses_vec_corrected_raw[15],
n14 = followup_gene_psy_brain_ses_vec_corrected_raw[8]+followup_gene_psy_brain_ses_vec_corrected_raw[13]+followup_gene_psy_brain_ses_vec_corrected_raw[14]+followup_gene_psy_brain_ses_vec_corrected_raw[15],
n24 = followup_gene_psy_brain_ses_vec_corrected_raw[9]+followup_gene_psy_brain_ses_vec_corrected_raw[12]+followup_gene_psy_brain_ses_vec_corrected_raw[13]+followup_gene_psy_brain_ses_vec_corrected_raw[15],
n34 = followup_gene_psy_brain_ses_vec_corrected_raw[10]+followup_gene_psy_brain_ses_vec_corrected_raw[12]+followup_gene_psy_brain_ses_vec_corrected_raw[14]+followup_gene_psy_brain_ses_vec_corrected_raw[15],
n123 = followup_gene_psy_brain_ses_vec_corrected_raw[11]+followup_gene_psy_brain_ses_vec_corrected_raw[15],
n124 = followup_gene_psy_brain_ses_vec_corrected_raw[13]+followup_gene_psy_brain_ses_vec_corrected_raw[15],
n134 = followup_gene_psy_brain_ses_vec_corrected_raw[14]+followup_gene_psy_brain_ses_vec_corrected_raw[15],
n234 = followup_gene_psy_brain_ses_vec_corrected_raw[12]+followup_gene_psy_brain_ses_vec_corrected_raw[15],
n1234 = followup_gene_psy_brain_ses_vec_corrected_raw[15],
category = c("Brain", "Mental \nHealth", "Genes","Socio-Demo \nLifestyle Dev"),
fill = c("#009E73", "#D55E00", "#CC79A7","#999999"),
lty = "dashed",
cat.col = c("#009E73", "#D55E00", "#CC79A7","#999999"),
filename = NULL,
cex = 2, ## label font size
cat.cex = 2,### caption font size
lwd = 2,
cat.fontface = "bold",
cat.dist = c(0.2, 0.25,0.1,0.13), # Modified
cat.pos = c(-5,10,1,-13),# Modified
#print.mode="percent"
)

grid.newpage()
#grid::grid.draw(quad_venn_followup_raw_label)
#invisible(dev.off())